/** * {@inheritDoc} */ public void init() throws FileSystemException { // check base path if (!fsBase.isFolder(basePath)) { fsBase.createFolder(basePath); } }
/** * {@inheritDoc} */ public void createFolder(String folderPath) throws FileSystemException { fsBase.createFolder(buildBasePath(folderPath)); }
/** * {@inheritDoc} */ public void init() throws FileSystemException { // check base path if (!fsBase.isFolder(basePath)) { fsBase.createFolder(basePath); } }
/** * {@inheritDoc} */ public void init() throws FileSystemException { // check base path if (!fsBase.isFolder(basePath)) { fsBase.createFolder(basePath); } }
/** * {@inheritDoc} */ public void createFolder(String folderPath) throws FileSystemException { fsBase.createFolder(buildBasePath(folderPath)); }
/** * {@inheritDoc} */ public void createFolder(String folderPath) throws FileSystemException { fsBase.createFolder(buildBasePath(folderPath)); }
/** * Creates the parent directory of this resource, including any necessary * but nonexistent parent directories. * * @throws FileSystemException */ public synchronized void makeParentDirs() throws FileSystemException { String parentDir = getParentDir(); if (!fs.exists(parentDir)) { fs.createFolder(parentDir); } }
/** * Creates the parent directory of this resource, including any necessary * but nonexistent parent directories. * * @throws FileSystemException */ public synchronized void makeParentDirs() throws FileSystemException { String parentDir = getParentDir(); if (!fs.exists(parentDir)) { fs.createFolder(parentDir); } }
/** * Creates the parent directory of this resource, including any necessary * but nonexistent parent directories. * * @throws FileSystemException */ public synchronized void makeParentDirs() throws FileSystemException { String parentDir = getParentDir(); if (!fs.exists(parentDir)) { fs.createFolder(parentDir); } }
/** * {@inheritDoc} */ public synchronized void store(NodeReferences refs) throws ItemStateException { if (!initialized) { throw new IllegalStateException("not initialized"); } try { StringBuffer buf = buildNodeFolderPath(null, refs.getTargetId()); buf.append('.'); buf.append(NODEREFSFILENAME); String fileName = buf.toString(); String dir = fileName.substring(0, fileName.lastIndexOf(FileSystem.SEPARATOR_CHAR)); if (!itemFs.exists(dir)) { itemFs.createFolder(dir); } OutputStream out = itemFs.getOutputStream(fileName); Serializer.serialize(refs, out); out.close(); } catch (Exception e) { String msg = "failed to write " + refs; BundleFsPersistenceManager.log.error(msg, e); throw new ItemStateException(msg, e); } }
/** * {@inheritDoc} */ public synchronized void store(NodeReferences refs) throws ItemStateException { if (!initialized) { throw new IllegalStateException("not initialized"); } try { StringBuffer buf = buildNodeFolderPath(null, refs.getTargetId()); buf.append('.'); buf.append(NODEREFSFILENAME); String fileName = buf.toString(); String dir = fileName.substring(0, fileName.lastIndexOf(FileSystem.SEPARATOR_CHAR)); if (!itemFs.exists(dir)) { itemFs.createFolder(dir); } OutputStream out = itemFs.getOutputStream(fileName); Serializer.serialize(refs, out); out.close(); } catch (Exception e) { String msg = "failed to write " + refs; BundleFsPersistenceManager.log.error(msg, e); throw new ItemStateException(msg, e); } }
/** * {@inheritDoc} */ protected synchronized void storeBundle(NodePropBundle bundle) throws ItemStateException { try { StringBuffer buf = buildNodeFolderPath(null, bundle.getId()); buf.append('.'); buf.append(NODEFILENAME); String fileName = buf.toString(); String dir = fileName.substring(0, fileName.lastIndexOf(FileSystem.SEPARATOR_CHAR)); if (!itemFs.exists(dir)) { itemFs.createFolder(dir); } OutputStream out = itemFs.getOutputStream(fileName); try { binding.writeBundle(out, bundle); } finally { out.close(); } } catch (Exception e) { String msg = "failed to write bundle: " + bundle.getId(); BundleFsPersistenceManager.log.error(msg, e); throw new ItemStateException(msg, e); } }
/** * {@inheritDoc} */ protected synchronized void storeBundle(NodePropBundle bundle) throws ItemStateException { try { StringBuffer buf = buildNodeFolderPath(null, bundle.getId()); buf.append('.'); buf.append(NODEFILENAME); String fileName = buf.toString(); String dir = fileName.substring(0, fileName.lastIndexOf(FileSystem.SEPARATOR_CHAR)); if (!itemFs.exists(dir)) { itemFs.createFolder(dir); } OutputStream out = itemFs.getOutputStream(fileName); try { binding.writeBundle(out, bundle); } finally { out.close(); } } catch (Exception e) { String msg = "failed to write bundle: " + bundle.getId(); BundleFsPersistenceManager.log.error(msg, e); throw new ItemStateException(msg, e); } }
try { virtualFS.createFolder(configDir);
try { virtualFS.createFolder(configDir);
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; }
try { if (!fs.exists(workspaceConfigDirectory)) { fs.createFolder(workspaceConfigDirectory); } else { String[] dirNames = fs.listFolders(workspaceConfigDirectory);
try { if (!fs.exists(workspaceConfigDirectory)) { fs.createFolder(workspaceConfigDirectory); } else { String[] dirNames = fs.listFolders(workspaceConfigDirectory);
fs.createFolder("/folder"); assertTrue(fs.exists("/folder")); assertTrue(fs.isFolder("/folder")); fs.createFolder("/folder2/subfolder"); createFile("/folder2/file2", sampleBytes); assertTrue(fs.exists("/folder2/subfolder")); fs.createFolder("/missing/subfolder"); assertTrue(fs.exists("/missing")); assertTrue(fs.isFolder("/missing"));