Set the base directory for local storage of files. Default is: {@code new File(System.getProperty("user.home"), ".deeplearning4j")}
@param f Base directory to use for resources
347196
public static void setBaseDirectory(@NonNull File f){
        Preconditions.checkState(f.exists() && f.isDirectory(), "Specified base directory does not exist and/or is not a directory: %s", f.getAbsolutePath());
        baseDirectory = f;
    }
394257
public void setFilePath(String filePath)
    {
        //create a new file
        File fileInstance=null;
        if(filePath!=null)
        {
            fileInstance=new File(filePath);
        }
        
        //set file
        this.setFile(fileInstance);
    }
643614
@Override
    public ICodeBaseLocator createFilesystemCodeBaseLocator(String pathName) {
        // Attempt to canonicalize the pathname.
        // It's not fatal if we can't.
        try {
            pathName = new File(pathName).getCanonicalPath();
        } catch (IOException e) {
            // Ignore
        }

        return new FilesystemCodeBaseLocator(pathName);
    }
1208899
@Override
  public boolean isDirectory(final Path f) throws IOException {
    if (stocatorPath.isTemporaryPath(f)) {
      return false;
    }
    final Path path = storageClient.qualify(f);
    try {
      FileStatus fileStatus = getFileStatus(path);
      LOG.debug("is directory: {} : {}", path.toString(), fileStatus.isDirectory());
      return fileStatus.isDirectory();
    } catch (FileNotFoundException e) {
      return false;
    }
  }
710540
public static DirectoryRosterStore init(final File baseDir) {
        DirectoryRosterStore store = new DirectoryRosterStore(baseDir);
        if (store.setRosterVersion("")) {
            return store;
        }
        else {
            return null;
        }
    }
886158
public static File getBaseDir(final List<File> files) {
        String common = getCommonPrefix(files.stream().map(new Function<File, String>() {
            @Override
            public String apply(final File file) {
                return file.getAbsolutePath();
            }
        }).collect(Collectors.toList()));
        if (null != common) {
            return new File(common);
        }
        return null;
    }
311026
public static FileChannel newFileChannel(Closeable ioObject, FileDescriptor fd, int mode) {
      ChannelFactory factory = ChannelFactory.INSTANCE;
      if (factory == null) {
        throw new LibraryNotLinkedError("Channel support", "jre_channels",
            "JavaNioChannelFactoryImpl");
      }
      return factory.newFileChannel(ioObject, fd, mode);
    }
913153
@Override
    public FatLfnDirectoryEntry addDirectory(String name) throws IOException {
        checkWritable();
        checkUniqueName(name);
        
        name = name.trim();
        final ShortName sn = makeShortName(name);
        final FatDirectoryEntry real = dir.createSub(fat);
        real.setShortName(sn);
        final FatLfnDirectoryEntry e =
                new FatLfnDirectoryEntry(this, real, name);
        
        try {
            dir.addEntries(e.compactForm());
        } catch (IOException ex) {
            final ClusterChain cc =
                    new ClusterChain(fat, real.getStartCluster(), false);
            cc.setChainLength(0);
            dir.removeEntry(real);
            throw ex;
        }
        
        shortNameIndex.put(sn, e);
        longNameIndex.put(name.toLowerCase(Locale.ROOT), e);

        getDirectory(real);
        
        flush();
        return e;
    }
373635
public void setLocal(final File value) {
    if (value == null) {
      throw new NullPointerException("value");
    }
    if (value.exists() && !value.isDirectory()) {
      throw new BuildException("local should be a directory");
    }
    this.localName = value;
    try {
      this.canonicalPath = this.localName.getCanonicalPath();
    } catch (final IOException ex) {
      throw new BuildException(ex);
    }
  }
363982
public static void createDirectories(final String directory) {
        if (directory == null) return;
        final File f = new File(directory);
        if (!f.isDirectory()) {
            if (!f.mkdirs()) throw new RuntimeException("couldn't create "
                    + directory);
        }
    }
1101259
@Override
    public ICodeBaseLocator createRelativeCodeBaseLocator(String relativePath) {
        File path = new File(pathName);
        if (!path.isDirectory()) {
            path = path.getParentFile();
        }
        File relativeFile = new File(path, relativePath);
        return new FilesystemCodeBaseLocator(relativeFile.getPath());
    }
578233
public void setWorkingDirectory(File dir) {
        if (!dir.exists()) {
            throw new IllegalArgumentException(dir + " doesn't exist.");
        }
        pb.directory(dir);
    }
802996
private File resolveBasedir() throws IOException {
    String path = null;

    if (project != null) {
      File file = project.getBasedir();
      if (file != null) {
        path = file.getAbsolutePath();
      }
    }

    if (path == null) {
      path = session.getExecutionRootDirectory();
    }

    if (path == null) {
      path = System.getProperty("user.dir");
    }

    return new File(path).getCanonicalFile();
  }
621174
public static NFSFileVec make(File f) {
    Futures fs = new Futures();
    NFSFileVec nfs = make(f, fs);
    fs.blockForPending();
    return nfs;
  }
494321
@Override
        public void setDirectory(File dir) {
                if (dir == null) {
                        throw new BuildException("Cannot set null directory attribute.");
                }

                // no override
                if (this.directory == null) {
                        this.directory = new File(dir.getAbsolutePath());
                }
        }
305507
private boolean delete(final File f) throws IOException {

		if (f.isDirectory()) {

			final File[] files = f.listFiles();
			for (int i = 0; i < files.length; i++) {
				final boolean del = delete(files[i]);
				if (del == false) {
					return false;
				}
			}

		} else {
			return f.delete();
		}

		// Now directory is empty
		return f.delete();
	}
804156
public static void setInitFilePath(String filePath) {
		filePath=getPropertiesFilePath(filePath);
		
		if (staticFileProperties == null) {
			staticFileProperties=new FileProperties(filePath);
		} else {
			staticFileProperties.setInitFilePath(filePath);
		}
	}