/** * Shorthand for {@link #getAbsolutePath()}. * * @return the value returned by {@link #getAbsolutePath()}. */ public final String getPath() { return getAbsolutePath(); }
/** * Returns a String representation of this file. The returned String is this file's path as returned by * {@link #getAbsolutePath()}. */ public String toString() { return getAbsolutePath(); }
/** * Returns a description of the file currently being presented which will be used as a window title. * This method returns the file's name but it can be overridden to provide more information. * @return this dialog's title. */ protected String getTitle() { return file.getAbsolutePath(); }
/** * Returns the canonical path to this file, resolving any symbolic links or '..' and '.' occurrences. * * <p>This implementation simply returns the value of {@link #getAbsolutePath()}, and thus should be overridden * if canonical path resolution is available.</p> * * @return the canonical path to this file */ public String getCanonicalPath() { return getAbsolutePath(); }
@Override public String getAbsolutePath() { if(!getAbsolutePathSet) { getAbsolutePath = file.getAbsolutePath(); getAbsolutePathSet = true; } return getAbsolutePath; }
/** * Make a content of .trashinfo file * @param file File for which the content is built * @return Final content */ private String getFileInfoContent(AbstractFile file) { synchronized(INFO_DATE_FORMAT) { // SimpleDateFormat is not thread safe return "[Trash Info]\n" + "Path=" + file.getAbsolutePath() + "\n" + "DeletionDate=" + INFO_DATE_FORMAT.format(new Date()); } }
/** * Make a content of .trashinfo file * @param file File for which the content is built * @return Final content */ private String getFileInfoContent(AbstractFile file) { synchronized(INFO_DATE_FORMAT) { // SimpleDateFormat is not thread safe return "[Trash Info]\n" + "Path=" + file.getAbsolutePath() + "\n" + "DeletionDate=" + INFO_DATE_FORMAT.format(new Date()); } }
@Override public void startDocument() { LOGGER.trace(file.getAbsolutePath()+" parsing started"); primaryActionsReadKeymap = new HashMap<String, KeyStroke>(); alternateActionsReadKeymap = new HashMap<String, KeyStroke>(); }
/** * Opens a backup output stream on the specified file. * @param file file on which to open a backup output stream. * @exception IOException thrown if any IO error occurs. */ public BackupOutputStream(AbstractFile file) throws IOException {this(file, FileFactory.getFile(file.getAbsolutePath() + BACKUP_SUFFIX));}
/** * Sets the path to the user actions file to be loaded when calling {@link #loadActionKeymap()}. * By default, this file is {@link #DEFAULT_ACTIONS_FILE_NAME} within the preferences folder. * @param file path to the actions file * @throws FileNotFoundException if <code>file</code> is not accessible. */ private static void setActionsFile(AbstractFile file) throws FileNotFoundException { if(file.isBrowsable()) throw new FileNotFoundException("Not a valid file: " + file.getAbsolutePath()); actionsFile = file; }
public static boolean isSystemFile(AbstractFile file) { for (MacOsSystemFolder folder : values()) if (folder.path.equals(file.getAbsolutePath())) return true; return false; } }
/** * Sets the path to the configuration file. * @param file path to the file that should be used for configuration storage. * @throws FileNotFoundException if the specified file is not a valid file. */ private synchronized void setConfigurationFile(AbstractFile file) throws FileNotFoundException { // Makes sure file can be used as a configuration. if(file.isBrowsable()) throw new FileNotFoundException("Not a valid file: " + file.getAbsolutePath()); configurationFile = file; }
public ArchiveJob(ProgressDialog progressDialog, MainFrame mainFrame, FileSet files, AbstractFile destFile, int archiveFormat, String archiveComment) { super(progressDialog, mainFrame, files); this.destFile = destFile; this.archiveFormat = archiveFormat; this.archiveComment = archiveComment; this.baseFolderPath = getBaseSourceFolder().getAbsolutePath(false); }
@Override public boolean isTrashFile(AbstractFile file) { return (file.getTopAncestor() instanceof LocalFile) && (file.getAbsolutePath(true).indexOf("/.Trash/") != -1); }
@Override public boolean isTrashFile(AbstractFile file) { return (file.getTopAncestor() instanceof LocalFile) && (file.getAbsolutePath(true).indexOf("/.local/share/Trash/") != -1); }
@Override public void execute(AbstractFile file) throws IOException { if(isAvailable()) getDesktop().open(new File(file.getAbsolutePath())); else throw new UnsupportedOperationException(); } /**
/** * Creates a new OpenLocationAction instance using the provided AbstractFile and label. */ public OpenLocationAction(MainFrame mainFrame, Map<String,Object> properties, AbstractFile file, String label) { super(mainFrame, properties); this.file = file; setLabel(label); setToolTipText(file.getAbsolutePath()); }
private IInArchive openSevenZipFile() throws IOException { if (sevenZipFile == null) { MuRandomAccessFile in = new MuRandomAccessFile(file); // MyRandomAccessFile in = new MyRandomAccessFile(file.getAbsolutePath(), "rw"); sevenZipFile = new Handler(); if (sevenZipFile.Open(in) != 0) throw new IOException("Error while opening 7zip archive " + file.getAbsolutePath()); } return sevenZipFile; }
/** * Returns the specified file's parent, or an empty string if it doesn't have one. * @param file file whose parent should be returned. * @return the specified file's parent, or an empty string if it doesn't have one. */ private String getParent(AbstractFile file) { AbstractFile parent; if((parent = file.getParent()) == null) return ""; return parent.getAbsolutePath(); }
@Override protected PathFieldContent computeInitialPath(FileSet files) { AbstractFile file = files.elementAt(0); // AbstractFile activeFolder = mainFrame.getActiveTable().getCurrentFolder(); AbstractFile unactiveFolder = mainFrame.getInactivePanel().getCurrentFolder(); // Fill text field with current folder's absolute path and file name return new PathFieldContent(unactiveFolder.getAbsolutePath(true)+file.getName()); }