Set the directory. If called outside the EDT this method will switch to
the UI thread using <code>SwingUtilities.invokeAndWait(Runnable)</code>.

@param directory
Path for the text field.
180187
public final void setDirectory(final String directory) {
        if (SwingUtilities.isEventDispatchThread()) {
            setDirectoryIntern(directory);
        } else {
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        setDirectoryIntern(directory);
                    }
                });
            } catch (final Exception ex) {
                ignore();
            }
        }
    }
765673
private void push(File directory) {
		// at this point file is guaranteed to be a directory
		stack.push(workingDirectory);
		workingDirectory = new Directory(directory);
		if (relativePath) {
			pathComponents.push(directory.getName());
		}
	}
831192
public final void setCurrentFile(final int n) {
        if (SwingUtilities.isEventDispatchThread()) {
            setCurrentFileIntern(n);
        } else {
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        setCurrentFileIntern(n);
                    }
                });
            } catch (final Exception ex) {
                ignore();
            }
        }
    }
900505
public void syncPersistNewDirectory(MutableInodeDirectory dir)
      throws InvalidPathException, FileDoesNotExistException, IOException {
    dir.setPersistenceState(PersistenceState.TO_BE_PERSISTED);
    syncPersistDirectory(dir).ifPresent(status -> {
      // If the directory already exists in the UFS, update our metadata to match the UFS.
      dir.setOwner(status.getOwner())
          .setGroup(status.getGroup())
          .setMode(status.getMode());

      Long lastModificationTime = status.getLastModifiedTime();
      if (lastModificationTime != null) {
        dir.setLastModificationTimeMs(lastModificationTime, true);
      }
    });
    dir.setPersistenceState(PersistenceState.PERSISTED);
  }
542359
public void setCompileDirectory(String directory) {
        if (directory != null && directory.trim().length() > 0) {
            File file = new File(directory);
            if (file.exists() || file.mkdirs()) {
                this.compileDirectory = file;
            }
        }
    }
152438
public static void mkdir(File dir) throws IOException{
        if(!dir.exists() && !dir.mkdir())
            throw new IOException("couldn't create directory: "+dir);
    }
685367
public void setTemplatesDirectory( String templatesDirectory ) {

		this.logger.fine( "Templates directory is now... " + templatesDirectory );
		this.templatesDIR = Utils.isEmptyOrWhitespaces( templatesDirectory ) ? null : new File( templatesDirectory );
		synchronized( this.watcherLock ) {
			if( this.templateWatcher != null )
				resetWatcher();
		}
	}
30363
public void cleanDirectory( final File directory )
        throws IOException
    {
        if ( !directory.exists() )
        {
            final String message = directory + " does not exist";
            throw new IllegalArgumentException( message );
        }

        if ( !directory.isDirectory() )
        {
            final String message = directory + " is not a directory";
            throw new IllegalArgumentException( message );
        }

        Delete deleteTask = new Delete();
        deleteTask.setProject(getProject());
		deleteTask.setDir(directory);
		deleteTask.execute();
		
		if(!directory.exists()){
			directory.mkdirs();
		}
    }
900314
public function setDirectory()
    {
        $pos = strrpos($this->dirPath, DIRECTORY_SEPARATOR);
        $this->directory = substr($this->dirPath, $pos + 1);
    }
1318053
public static synchronized void chdir(String path) {
		if (path != null) {
			rootDir = new File(getAbsolutePath(path)).getAbsolutePath();
		}
	}
1263182
public function setTemplateDirectory($directory)
    {
        // The directory will be null if a template is being loaded from storage.
        if ($directory == null) {
            $this->templateDirectory = realpath(find_tse_template($this->templateName));
            $this->loadPackageTemplate($this->templateDirectory);
            return;
        }

        $this->templateDirectory = realpath($directory);
        $this->loadPackageTemplate(realpath($directory));
    }
941060
public void setWorkingDirectory(String path) {
        if (path != null) {
            File dir = new File(path);
            checkWorkingDir(dir);
            workingDir = dir;
        } else {
            workingDir = null;
        }
    }
138119
public static void cleanDirectory(File directory) throws IOException {
    requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL);
    if (!directory.exists()) {
      return;
    }

    cleanDirectoryImpl(directory.toPath());
  }
645211
@Override
	public void setWorkingDirectory(String workingDir) {
		this.workingDir = workingDir;
		if (!this.workingDir.endsWith(URL_SEPARATOR)) {
			this.workingDir = this.workingDir + URL_SEPARATOR;
		}
	}
1205062
public void setSourceDirectory (final File directory)
  {
    if (!directory.isAbsolute ())
    {
      throw new IllegalArgumentException ("source directory is not absolute: " + directory);
    }
    this.scanner.setBasedir (directory);
  }
1370065
private static void createDirectory(final File directory) throws MojoExecutionException
  {

    try {
      com.sap.prd.mobile.ios.mios.FileUtils.deleteDirectory(directory);
    }
    catch (IOException ex) {
      throw new MojoExecutionException("", ex);
    }

    if (!directory.mkdirs())
      throw new MojoExecutionException("Cannot create directory (" + directory + ")");
  }
1352118
@Requires("location != null")
  public void setLocation(Location location, List<? extends File> path)
      throws IOException {
    fileManager.setLocation(location, path);
  }