public synchronized boolean inUse() throws FileNotFoundException { if (users == null) throw new FileNotFoundException("File was deleted " + PrivilegedFileHelper.getAbsolutePath(this)); return users.size() > 0; }
public synchronized void release(Object holder) throws FileNotFoundException { if (users == null) throw new FileNotFoundException("File was deleted " + PrivilegedFileHelper.getAbsolutePath(this)); users.remove(holder); }
public synchronized void acquire(Object holder) throws FileNotFoundException { if (users == null) throw new FileNotFoundException("File was deleted " + PrivilegedFileHelper.getAbsolutePath(this)); users.put(holder, System.currentTimeMillis()); }
/** * Remove buffer. * * @throws IOException * if file cannot be removed. */ public void remove() throws IOException { if ((fileBuffer != null) && PrivilegedFileHelper.exists(fileBuffer)) { if (!PrivilegedFileHelper.delete(fileBuffer)) { throw new IOException("Cannot remove file " + PrivilegedFileHelper.getAbsolutePath(fileBuffer) + " Close all streams."); } } }
public static SpoolFile createTempFile(final String prefix, final String suffix, final File directory) throws IOException { return new SpoolFile(PrivilegedFileHelper.getAbsolutePath(PrivilegedFileHelper.createTempFile(prefix, suffix, directory))); }
public BackupWorkspaceInitializer(WorkspaceEntry config, RepositoryEntry repConfig, CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl namespaceRegistry, LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager, ValueFactoryImpl valueFactory, AccessManager accessManager) throws RepositoryConfigurationException, PathNotFoundException, RepositoryException { super(config, repConfig, dataManager, namespaceRegistry, locationFactory, nodeTypeManager, valueFactory, accessManager); restoreDir = restorePath; String fullBackupPath = PrivilegedFileHelper.getAbsolutePath(JCRRestore.getFullBackupFile(new File(restoreDir))); if (fullBackupPath == null) { throw new RepositoryException("Can't find full backup storage"); } else { restorePath = fullBackupPath; } }
public boolean delete() String path = PrivilegedFileHelper.getAbsolutePath(this); WeakReference<SwapFile> currentValue = CURRENT_SWAP_FILES.get(path); if (currentValue == null || (currentValue.get() == this || currentValue.get() == null))
String absPath = PrivilegedFileHelper.getAbsolutePath(newsf); throw new IOException("Swap file read error " + PrivilegedFileHelper.getAbsolutePath(swapped) + ". " + e)
+ ". Will try next time: " + PrivilegedFileHelper.getAbsolutePath(file)); + PrivilegedFileHelper.getAbsolutePath(file));
public Boolean run() { if (sf.exists()) { if (SwapFile.super.delete()) { return true; } else if (swapCleaner != null) { swapCleaner.addFile(SwapFile.super.getAbsoluteFile()); } if (LOG.isDebugEnabled()) { LOG.debug("Could not remove swap file on finalize : " + PrivilegedFileHelper.getAbsolutePath(SwapFile.super.getAbsoluteFile())); } return false; } return true; } };
PrivilegedFileHelper.getAbsolutePath(getIndexDirectory()), extractor, true, recoveryFilterUsed, virtualTableResolver, indexRecovery, rpcService, repositoryName, wsId, cleanerHolder);
/** * Delete current spool file. * * @throws IOException * if error */ private void removeSpoolFile() throws IOException { if (spoolFile != null) { if (spoolFile instanceof SpoolFile) { (spoolFile).release(this); } if (PrivilegedFileHelper.exists(spoolFile)) { if (!PrivilegedFileHelper.delete(spoolFile)) { spoolConfig.fileCleaner.addFile(spoolFile); if (LOG.isDebugEnabled()) { LOG.debug("Could not remove file. Add to fileCleaner " + PrivilegedFileHelper.getAbsolutePath(spoolFile)); } } } } }
+ PrivilegedFileHelper.getAbsolutePath(sourceConfig), ioe);
PrivilegedFileHelper.getAbsolutePath(pfile)), spoolConfig);