private void assertIsFile(String filePath) throws FileSystemException { if (!isFile(filePath)) { throw new FileSystemException(filePath + " is a folder"); } }
void delete(boolean pruneEmptyParentDirs) { try { fsResource.delete(pruneEmptyParentDirs); } catch (FileSystemException fse) { // ignore LOG.warn("Error while deleting BLOBFileValue: " + fse.getMessage()); } }
/** * Creates a new instance from a stream. * * @param fsResource the file system resource * @throws IOException */ private BLOBInResource(FileSystemResource fsResource) throws IOException { try { if (!fsResource.exists()) { throw new IOException(fsResource.getPath() + ": the specified resource does not exist"); } length = fsResource.length(); } catch (FileSystemException fse) { IOException e2 = new IOException(fsResource.getPath() + ": Error while creating value: " + fse.toString()); e2.initCause(fse); throw e2; } this.fsResource = fsResource; }
/** * Creates a new instance from a stream. * * @param fsResource the file system resource * @throws IOException */ private BLOBInResource(FileSystemResource fsResource) throws IOException { try { if (!fsResource.exists()) { throw new IOException(fsResource.getPath() + ": the specified resource does not exist"); } length = fsResource.length(); } catch (FileSystemException fse) { IOException e2 = new IOException(fsResource.getPath() + ": Error while creating value: " + fse.toString()); e2.initCause(fse); throw e2; } this.fsResource = fsResource; }
private void assertExistence(String path) throws FileSystemException { if (!exists(path)) { throw new FileSystemException("no such file " + path); } }
void delete(boolean pruneEmptyParentDirs) { try { fsResource.delete(pruneEmptyParentDirs); } catch (FileSystemException fse) { // ignore LOG.warn("Error while deleting BLOBFileValue: " + fse.getMessage()); } }
private void assertIsFile(String filePath) throws FileSystemException { if (!isFile(filePath)) { throw new FileSystemException(filePath + " is a folder"); } }
log.error("Error while saving locks to '" + retentionFile.getPath() + "': " + fse.getMessage()); } catch (IOException ioe) { log.error("Error while saving locks to '" + retentionFile.getPath() + "': " + ioe.getMessage());
private void assertExistence(String path) throws FileSystemException { if (!exists(path)) { throw new FileSystemException("no such file " + path); } }
log.error("Error while saving locks to '" + retentionFile.getPath() + "': " + fse.getMessage()); } catch (IOException ioe) { log.error("Error while saving locks to '" + retentionFile.getPath() + "': " + ioe.getMessage());
/** * {@inheritDoc} */ public String[] list(String folderPath) throws FileSystemException { File f = new File(root, osPath(folderPath)); String[] entries = f.list(); if (entries == null) { String msg = folderPath + " does not denote a folder"; log.debug(msg); throw new FileSystemException(msg); } return entries; }
+ locksFile.getPath() + "': " + fse.getMessage()); log.debug("Root cause: ", fse); } catch (IOException ioe) {
throw new FileSystemException("null path"); throw new FileSystemException("not an absolute path: " + path); throw new FileSystemException("malformed path: " + path); throw new FileSystemException("empty name: " + path); throw new FileSystemException("illegal leading or trailing whitespace in name: " + path);
+ locksFile.getPath() + "': " + fse.getMessage()); log.debug("Root cause: ", fse); } catch (IOException ioe) {
throw new FileSystemException("null path"); throw new FileSystemException("not an absolute path: " + path); throw new FileSystemException("malformed path: " + path); throw new FileSystemException("empty name: " + path); throw new FileSystemException("illegal leading or trailing whitespace in name: " + path);
private FileSystem createFileSystem() { FileSystem fs = new MemoryFileSystem(); BufferedWriter writer = null; try { fs.createFolder("/"); FileSystemResource file = new FileSystemResource(fs, "/retention"); writer = new BufferedWriter(new OutputStreamWriter(file.getOutputStream())); writer.write(((NodeImpl) childN).getNodeId().toString()); } catch (FileSystemException e) { log.error(e.getMessage()); } catch (IOException e) { log.error(e.getMessage()); } finally { IOUtils.closeQuietly(writer); } return fs; }
throw new FileSystemException("null path"); throw new FileSystemException("not an absolute path: " + path); throw new FileSystemException("malformed path: " + path); throw new FileSystemException("empty name: " + path); throw new FileSystemException("illegal leading or trailing whitespace in name: " + path);
/** * {@inheritDoc} */ public String[] list(String folderPath) throws FileSystemException { File f = new File(root, osPath(folderPath)); String[] entries = f.list(); if (entries == null) { String msg = folderPath + " does not denote a folder"; log.debug(msg); throw new FileSystemException(msg); } return entries; }
/** * {@inheritDoc} */ public void createFolder(String folderPath) throws FileSystemException { File f = new File(root, osPath(folderPath)); if (f.exists()) { String msg = f.getPath() + " already exists"; log.debug(msg); throw new FileSystemException(msg); } if (!f.mkdirs()) { String msg = "failed to create folder " + f.getPath(); log.debug(msg); throw new FileSystemException(msg); } }
/** * {@inheritDoc} */ public void createFolder(String folderPath) throws FileSystemException { File f = new File(root, osPath(folderPath)); if (f.exists()) { String msg = f.getPath() + " already exists"; log.debug(msg); throw new FileSystemException(msg); } if (!f.mkdirs()) { String msg = "failed to create folder " + f.getPath(); log.debug(msg); throw new FileSystemException(msg); } }