Set input directory
@param dir absolute input directory path
188416
public void setInputDir(final URI dir) {
        assert dir.isAbsolute();
        setProperty(INPUT_DIR_URI, dir.toString());
        // Deprecated since 2.2
        if (dir.getScheme().equals("file")) {
            setProperty(INPUT_DIR, new File(dir).getAbsolutePath());
        }
    }
1156861
public static void createDirectory(final String directory) {
        if (directory == null) return;
        final File f = new File(directory);
        if (!f.isDirectory()) {
            if (!f.mkdir()) throw new RuntimeException("couldn't create "
                    + directory);
        }
    }
522411
static public void emptyDirectory(File dir) throws Exception {
		String[] fileNames = dir.list();
		if( null != fileNames ) {
			for(String fileName : fileNames){
				File file = new File(dir,fileName);
				if( file.isDirectory() ) {
					emptyDirectory(file);
				}
				boolean deleted = false;
				try {
					deleted = file.delete();
				} catch(Exception e) {
					throw new Exception("Unable to delete: "+file.getAbsolutePath(),e);
				}
				if( !deleted ){
					throw new Exception("Unable to delete: "+file.getAbsolutePath());
				}
			}
		}
	}
163884
public static void deleteDirectory(File dir) {
        if (!dir.exists()) {
            return;
        }

        if (dir.isDirectory()) {
            for (File child : dir.listFiles()) {
                deleteDirectory(child);
            }
            dir.delete();
        } else {
            dir.delete();
        }
    }
475852
public void setDir(File dir) {
    final FileSet fs = new FileSet();
    fs.setProject(getProject());
    fs.setDir(dir);
    // needed if somebody sets restrictClassFilename=false:
    fs.setIncludes("**/*.class");
    classFiles.add(fs);
  }
1138540
public void setWorkingDirectory(Path dir) throws IOException {
    ensureState(JobState.DEFINE);
    conf.setWorkingDirectory(dir);
  }
601042
public static void removeDirectory(File dir) throws IOException
   {
      if (dir.isDirectory())
      {
         for (File subFile : dir.listFiles())
         {
            removeDirectory(subFile);
         }

         if (!dir.delete())
         {
            throw new IOException("Can't remove folder : " + dir.getCanonicalPath());
         }
      }
      else
      {
         if (!dir.delete())
         {
            throw new IOException("Can't remove file : " + dir.getCanonicalPath());
         }
      }
   }
296069
public static void setInputPaths(JobConf conf, Path... inputPaths) {
    if (!inputPaths[0].isAbsolute()) {
      FileSystem.LogForCollect.info("set relative path to non absolute path: "
          + inputPaths[0]+ " working directory: " + conf.getWorkingDirectory());
    }
    Path path = new Path(conf.getWorkingDirectory(), inputPaths[0]);
    StringBuffer str = new StringBuffer(StringUtils.escapeString(path.toString()));
    for(int i = 1; i < inputPaths.length;i++) {
      str.append(StringUtils.COMMA_STR);
      if (!inputPaths[i].isAbsolute()) {
        FileSystem.LogForCollect.info("set input path to non absolute path: "
            + inputPaths[i] + " working directory: "
            + conf.getWorkingDirectory());
      }
      path = new Path(conf.getWorkingDirectory(), inputPaths[i]);
      str.append(StringUtils.escapeString(path.toString()));
    }
    conf.set("mapred.input.dir", str.toString());
  }
633840
private void walkDir(File dir) {
        walkDir(
                dir,
                new FileFilter() {
                    @Override
                    public boolean accept(File pathname) {
                        return ( pathname.isFile() && pathname.getName().endsWith( ".class" ) );
                    }
                },
                new FileFilter() {
                    @Override
                    public boolean accept(File pathname) {
                        return ( pathname.isDirectory() );
                    }
                }
        );
    }
1246348
public static void setLogDir(String dir) {
		try { 
			logDir = dir;
			for (Entry<Class<?>, Logger> en : loggers.entrySet()) {
				FileHandler fh = new FileHandler(logDir+File.separator+en.getKey().getSimpleName()+".log");
				fh.setFormatter(getFormatter(en.getValue(),true));
				en.getValue().addHandler(fh);
			}
		}
		catch (SecurityException e) { e.printStackTrace(); }
		catch (IOException e) { e.printStackTrace(); }  
	}
255914
public void setDirectoryPath(String pidsfilepath) {
        File pidsfile = new File(pidsfilepath);
        directoryPath = pidsfile.getParent();
    }
922588
public function setDir($dir)
    {
        if (in_array($dir, Direction::asArray(), true) === true) {
            $this->dir = $dir;
        } else {
            $msg = "The 'dir' argument must be a value from the Direction enumeration.";
            throw new InvalidArgumentException($msg);
        }
    }
972495
public void setDirectory(final String directory) {
        this.directory = new File(this.configuration.getDirectory(), directory);
        if (!this.directory.exists()) {
            throw new IllegalArgumentException(String.format(
                    "Directory does not exist: %s.\n" +
                            "Configuration contained value %s which is supposed to be relative to " +
                            "configuration directory.",
                    this.directory, directory));
        }

        if (!this.directory.getAbsolutePath()
                .startsWith(this.configuration.getDirectory().getAbsolutePath())) {
            throw new IllegalArgumentException(String.format(
                    "All files and directories must be contained in the configuration directory the " +
                            "directory provided in the configuration breaks that contract: %s in config " +
                            "file resolved to %s.",
                    directory, this.directory));
        }
    }
381509
public void setDataHomeFile(File dir) {
        if (dir != null) {
            try {
                // Switch to canonical for more detailed error messages.
                dir = dir.getCanonicalFile();
            } catch (IOException e) {
            }
        }
        mDataHome = dir;
    }
1039192
public function setTargetDir ($dir)
		{
			$this->_targetDir = $dir;
			if (!is_dir($this->_targetDir))
				FileHelper::createDirectory($this->_targetDir);
		}
161665
public void addDir(String dirName) {
        Path dir = Paths.get(dirName);

        if (Files.isDirectory(dir)) {
            list.add(new DirPathEntry(dir));
        }
    }
426091
public static void setInputPaths(Job job, 
                                   Path... inputPaths) throws IOException {
    Configuration conf = job.getConfiguration();
    FileSystem fs = FileSystem.get(conf);
    Path path = inputPaths[0].makeQualified(fs);
    StringBuffer str = new StringBuffer(StringUtils.escapeString(path.toString()));
    for(int i = 1; i < inputPaths.length;i++) {
      str.append(StringUtils.COMMA_STR);
      path = inputPaths[i].makeQualified(fs);
      str.append(StringUtils.escapeString(path.toString()));
    }
    conf.set("mapred.input.dir", str.toString());
  }