Package com.hdfsTools.action

Source Code of com.hdfsTools.action.renameAction

package com.hdfsTools.action;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;

import com.hdfsTools.dao.renameDao;
import com.hdfsTools.impl.renameImpl;

public class renameAction extends BaseAction {

  public renameAction() {
  }

  /**
   * urlConfiguration
   *
   * @param fsUrl
   *            url,example: hdfs://localhost:8889
   */
  /*
   * public renameAction(String fsUrl){ super(fsUrl); }
   */

  public renameAction(Configuration conf) {
    super(conf);
  }

  /**
   *
   * @param src
   *            ,,url
   * @param dst
   *            , ,url
   * @return
   *
   * @throws IOException
   */
  public boolean rename(String src, String dst) throws IOException {

    renameDao rename = new renameImpl();

    return rename.rename(getConf(), src, dst);
  }

  public static void main(String args[]) throws IOException {
    renameAction rename = new renameAction();
    String src = "/user/gg.txt1";
    String dst = "/gg.txt1";
    rename.rename(src, dst);
  }
}
TOP

Related Classes of com.hdfsTools.action.renameAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.