Code example for File

Methods: getAbsolutePathgetParentFile, File.listFiles

0
 
	/** 
	 * Browses to the current directory. 
	 */ 
	private void browseToCurrentDirectory() { 
		setTitle(this.currentDirectory.getAbsolutePath());
 
		// read the subfolders and files from the current directory 
		if (fileDisplayFilter == null) {
			this.files = this.currentDirectory.listFiles();
		} else { 
			this.files = this.currentDirectory.listFiles(fileDisplayFilter);
		} 
 
		if (this.files == null) {
			this.files = new File[0];
		} else { 
			// order the subfolders and files 
			Arrays.sort(this.files, fileComparator);
		} 
 
		// if a parent directory exists, add it at the first position 
		if (this.currentDirectory.getParentFile() != null) {
			this.filesWithParentFolder = new File[this.files.length + 1];
			this.filesWithParentFolder[0] = this.currentDirectory.getParentFile();
			System.arraycopy(this.files, 0, this.filesWithParentFolder, 1, this.files.length);
			this.files = this.filesWithParentFolder;
			this.filePickerIconAdapter.setFiles(this.files, true);
		} else { 
			this.filePickerIconAdapter.setFiles(this.files, false);
Connect your IDE to all the code out there  Get Codota for Java