/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Add the given managed file name to the list of files managed by this manager. * * @param managedFile name of the file to manage * @throws IOException if there are any problems adding the given file name to the manager */ public void add(String managedFile) throws IOException { add(managedFile, FILETYPE_STANDARD); }
/** * Returns the actual file location to use when reading the given managed file. * A value of <code>null</code> can be returned if the given managed file name is not * managed and add is set to false. * <p> * The returned file should be considered read-only. Any updates to the content of this * file should be done using {@link #update(String[], String[])}. * * @param managedFile the managed file to lookup * @param add indicate whether the managed file name should be added to the manager if * it is not already managed. * @throws IOException if the add flag is set to true and the addition of the managed file failed * @return the absolute file location to use for the given managed file or * <code>null</code> if the given managed file is not managed */ public File lookup(String managedFile, boolean add) throws IOException { if (!open) throw new IOException(Msg.fileManager_notOpen); Entry entry = (Entry) table.get(managedFile); if (entry == null) { if (add) { add(managedFile); entry = (Entry) table.get(managedFile); } else { return null; } } return new File(getAbsolutePath(managedFile + '.' + entry.getReadId())); }
/** * Returns the actual file location to use when reading the given managed file. * A value of <code>null</code> can be returned if the given managed file name is not * managed and add is set to false. * <p> * The returned file should be considered read-only. Any updates to the content of this * file should be done using {@link #update(String[], String[])}. * * @param managedFile the managed file to lookup * @param add indicate whether the managed file name should be added to the manager if * it is not already managed. * @throws IOException if the add flag is set to true and the addition of the managed file failed * @return the absolute file location to use for the given managed file or * <code>null</code> if the given managed file is not managed */ public File lookup(String managedFile, boolean add) throws IOException { if (!open) throw new IOException(Msg.fileManager_notOpen); Entry entry = (Entry) table.get(managedFile); if (entry == null) { if (add) { add(managedFile); entry = (Entry) table.get(managedFile); } else { return null; } } return new File(getAbsolutePath(managedFile + '.' + entry.getReadId())); }
/** * Returns the actual file location to use when reading the given managed file. * A value of <code>null</code> can be returned if the given managed file name is not * managed and add is set to false. * <p> * The returned file should be considered read-only. Any updates to the content of this * file should be done using {@link #update(String[], String[])}. * * @param managedFile the managed file to lookup * @param add indicate whether the managed file name should be added to the manager if * it is not already managed. * @throws IOException if the add flag is set to true and the addition of the managed file failed * @return the absolute file location to use for the given managed file or * <code>null</code> if the given managed file is not managed */ public File lookup(String managedFile, boolean add) throws IOException { if (!open) throw new IOException(Msg.fileManager_notOpen); Entry entry = (Entry) table.get(managedFile); if (entry == null) { if (add) { add(managedFile); entry = (Entry) table.get(managedFile); } else { return null; } } return new File(getAbsolutePath(managedFile + '.' + entry.getReadId())); }
/** * Returns the actual file location to use when reading the given managed file. * A value of <code>null</code> can be returned if the given managed file name is not * managed and add is set to false. * <p> * The returned file should be considered read-only. Any updates to the content of this * file should be done using {@link #update(String[], String[])}. * * @param managedFile the managed file to lookup * @param add indicate whether the managed file name should be added to the manager if * it is not already managed. * @throws IOException if the add flag is set to true and the addition of the managed file failed * @return the absolute file location to use for the given managed file or * <code>null</code> if the given managed file is not managed */ public File lookup(String managedFile, boolean add) throws IOException { if (!open) throw new IOException(Msg.fileManager_notOpen); Entry entry = (Entry) table.get(managedFile); if (entry == null) { if (add) { add(managedFile); entry = (Entry) table.get(managedFile); } else { return null; } } return new File(getAbsolutePath(managedFile + '.' + entry.getReadId())); }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }
private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId(); // attempt to rename the file to the next generation boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) { //possible the next write generation file exists? Lets determine the largest //generation number, then use that + 1. newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); } if (!success) return false; // update the entry. read and write ids should be the same since // everything is in sync entry.setReadId(newId); entry.setWriteId(newId + 1); return true; }