/** * 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(File file) throws IOException {this(FileFactory.getFile(file.getAbsolutePath()));}
/** * Returns the user home folder. Most if not all OSes have one, but in the unlikely event that the OS doesn't have * one or that the folder cannot be resolved, <code>null</code> will be returned. * * @return the user home folder */ public static AbstractFile getUserHome() { String userHomePath = System.getProperty("user.home"); if(userHomePath==null) return null; return FileFactory.getFile(userHomePath); }
/** * 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(String file) throws IOException {this(FileFactory.getFile((new File(file)).getAbsolutePath()));}
/** * 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(File file) throws FileNotFoundException {setConfigurationFile(FileFactory.getFile(file.getAbsolutePath()));}
@Override public AbstractFile getParent() { if(!parentValSet) { FileURL parentFileURL = this.fileURL.getParent(); if(parentFileURL!=null) { parent = FileFactory.getFile(parentFileURL); // Note: parent may be null if it can't be resolved } parentValSet = true; } return parent; }
/** * 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 custom associations file. * <p> * This is a convenience method and is strictly equivalent to calling <code>setAssociationFile(FileFactory.getFile(file.getAbsolutePath()))</code>. * </p> * @param file path to the custom associations file. * @throws FileNotFoundException if <code>file</code> is not accessible. * @see #getAssociationFile() * @see #loadAssociations() * @see #writeAssociations() */ public static void setAssociationFile(File file) throws FileNotFoundException {setAssociationFile(FileFactory.getFile(file.getAbsolutePath()));}
/** * Sets the path to the custom commands file. * <p> * This is a convenience method and is strictly equivalent to calling <code>setCommandFile(FileFactory.getFile(file.getAbsolutePath()));</code>. * </p> * @param file path to the custom commands file. * @throws FileNotFoundException if <code>file</code> is not accessible. * @see #getCommandFile() * @see #loadCommands() * @see #writeCommands() */ public static void setCommandFile(File file) throws FileNotFoundException {setCommandFile(FileFactory.getFile(file.getAbsolutePath()));}
/** * 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. * <p> * This is a convenience method and is strictly equivalent to calling <code>setActionsFile(FileFactory.getFile(file.getAbsolutePath()))</code>. * </p> * @param file path to the actions file * @throws FileNotFoundException if <code>file</code> is not accessible. */ private static void setActionsFile(File file) throws FileNotFoundException {setActionsFile(FileFactory.getFile(file.getAbsolutePath()));}
/** * Sets the path to the bookmarks file. * <p> * This is a convenience method and is strictly equivalent to calling <code>setBookmarksFile(FileFactory.getFile(file.getAbsolutePath()))</code>. * </p> * @param file path to the bookmarks file * @exception FileNotFoundException if <code>path</code> is not accessible. * @see #getBookmarksFile() */ public static void setBookmarksFile(File file) throws FileNotFoundException {setBookmarksFile(FileFactory.getFile(file.getAbsolutePath()));}
/** * Opens a backup input stream on the specified file. * @param file file to open for reading. * @exception IOException thrown if any IO related error occurs. */ public BackupInputStream(File file) throws IOException {super(getInputStream(FileFactory.getFile(file.getAbsolutePath())));}
/** * Sets the path to the credentials file. * * @param file path to the credentials file * @throws FileNotFoundException if <code>path</code> is not available. */ public static void setCredentialsFile(File file) throws FileNotFoundException { setCredentialsFile(FileFactory.getFile(file.getAbsolutePath())); }
/** * Sets the path to the command bar description file to be loaded when calling {@link #loadCommandBar()}. * By default, this file is {@link #DEFAULT_COMMAND_BAR_FILE_NAME} within the preferences folder. * @param file path to the command bar descriptor file * @throws FileNotFoundException if the specified file is not accessible. */ public static void setDescriptionFile(File file) throws FileNotFoundException {setDescriptionFile(FileFactory.getFile(file.getAbsolutePath()));}
/** * Sets the path to the user theme file. * <p> * The specified file does not have to exist. If it does, however, it must be accessible. * </p> * @param file path to the user theme file. * @throws FileNotFoundException if <code>file</code> is not accessible. * @see #getUserThemeFile() */ public static void setUserThemeFile(File file) throws FileNotFoundException {setUserThemeFile(FileFactory.getFile(file.getAbsolutePath()));}
/** * Opens a backup input stream on the specified file. * @param path path to the file to open for reading. * @exception IOException thrown if any IO related error occurs. */ public BackupInputStream(String path) throws IOException {super(getInputStream(FileFactory.getFile((new File(path)).getAbsolutePath())));}
/** * Sets the path of the shell history file. * @param file where to load the shell history from. * @exception FileNotFoundException if <code>path</code> is not accessible. * @see #getHistoryFile() * @see #setHistoryFile(AbstractFile) * @see #setHistoryFile(String) */ public static void setHistoryFile(File file) throws FileNotFoundException {setHistoryFile(FileFactory.getFile(file.getAbsolutePath()));}
/** * Sets the path to the configuration file. * @param path 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(String path) throws FileNotFoundException { AbstractFile file; if((file = FileFactory.getFile(path)) == null) setConfigurationFile(new File(path)); else setConfigurationFile(file); }
@Override public AbstractFile getParent() { if(!parentValSet) { FileURL parentFileURL = this.fileURL.getParent(); if(parentFileURL!=null) parent = FileFactory.getFile(fileURL.getParent()); parentValSet = true; } return parent; }
@Override public InputStream getEntryInputStream(ArchiveEntry entry, ArchiveEntryIterator entryIterator) throws IOException, UnsupportedFileOperationException { // Will throw an IOException if the file designated by the entry doesn't exist return FileFactory.getFile(((LstArchiveEntry)entry).getBaseFolder()+entry.getPath(), true).getInputStream(); } }
@Override public AbstractFile getRoot() { FileURL rootURL = (FileURL) getURL().clone(); String rootPath = getRootPath(); rootURL.setPath("/" + vmIdentifier + "/" + rootPath); return FileFactory.getFile(rootURL); }