/** * Adds a junction to this file system. */ public void addJunction(final String junctionPoint, final FileObject targetFile) throws FileSystemException { throw new FileSystemException("vfs.provider/junctions-not-supported.error", rootName); }
/** * Constructor * * @param root */ public SFTPRepository(String root) { try { this.root = this.fsManager.resolveFile(root); } catch (FileSystemException e) { e.printStackTrace(); } }
/** * retrieve message from bundle */ public String getMessage() { return Messages.getString(super.getMessage(), getInfo()); }
/** * Clear the cache and re-request the file object */ private void refresh() { try { this.file.refresh(); } catch (FileSystemException fse) { log.error(fse.getLocalizedMessage(), fse); } }
private void setFileType(FileType type) { if (type != null && type != FileType.IMAGINARY) { try { name.setType(type); } catch (FileSystemException e) { throw new RuntimeException(e.getMessage()); } } this.type = type; }
Message.error(e.getLocalizedMessage()); IOException error = new IOException(e.getLocalizedMessage()); error.initCause(e); throw error;
public String getContentEncoding() { try { return content.getContentInfo().getContentEncoding(); } catch (FileSystemException e) { throw new RuntimeException(e.getMessage()); } }
/** * Lists the children of the file. */ protected String[] doListChildren() throws Exception { throw new FileSystemException("Not implemented."); }
log.error(fse.getLocalizedMessage(), fse);
public RepositoryManager() { try { fsManager = VFS.getManager(); } catch (FileSystemException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public String getContentType() { try { return content.getContentInfo().getContentType(); } catch (FileSystemException e) { throw new RuntimeException(e.getMessage()); } }
/** * Retrieves the attribute with the specified name. The default * implementation simply throws an exception. */ public Object getAttribute(final String attrName) throws FileSystemException { throw new FileSystemException("vfs.provider/get-attribute-not-supported.error"); }
/** * Adds a file to be monitored. */ public void addFile(final FileObject file) { _addFile(file); try { // add all direct children too if (file.getType().hasChildren()) { // Traverse the children final FileObject[] children = file.getChildren(); for (int i = 0; i < children.length; i++) { _addFile(children[i]); } } } catch (FileSystemException fse) { log.error(fse.getLocalizedMessage(), fse); } }
/** * This method returns a list a files that have been filtered * * @param startingDir * @param filter * @param searchRecursively * @return */ public FileObject[] getFileList(FileObject startingDir, FileSelector selector, boolean searchRecursively) { FileObject[] filelist = null; try { filelist = startingDir.findFiles(selector); } catch (FileSystemException e) { e.printStackTrace(); } return filelist; }
/** * Called when the children of this file change. */ protected void onChildrenChanged(FileName child, FileType newType) { if (children != null && newType.equals(FileType.IMAGINARY)) { try { children.remove(UriParser.decode(child.getBaseName())); } catch (FileSystemException e) { throw new RuntimeException(e.getMessage()); } } else { // if child was added we have to rescan the children // TODO - get rid of this children = null; } }
/** * Creates access to the file for random i/o. Is only called * if {@link #doGetType} returns {@link FileType#FILE}. * <p/> * <p>It is guaranteed that there are no open output streams for this file * when this method is called. * <p/> */ protected RandomAccessContent doGetRandomAccessContent(final RandomAccessMode mode) throws Exception { throw new FileSystemException("vfs.provider/random-access-not-supported.error"); }
log.error(fse.getLocalizedMessage(), fse);
/** * Constructor * * @param rootFileUrl * The root directory of the repository. */ public LocalRepository(String rootFileUrl) { try { this.setFsManager(VFS.getManager()); this.root = this.fsManager.resolveFile(rootFileUrl); this.fsManager.createFileSystem(root); } catch (FileSystemException e) { e.printStackTrace(); } }
/** * Implement Comparable * * @param obj another abstractfilename */ public int compareTo(Object obj) { final AbstractFileName name = (AbstractFileName) obj; int ret = getRootURI().compareTo(name.getRootURI()); if (ret != 0) { return ret; } // return absPath.compareTo(name.absPath); try { return getPathDecoded().compareTo(name.getPathDecoded()); } catch (FileSystemException e) { throw new RuntimeException(e.getMessage()); } }
/** * Locates the local file provider. */ private LocalFileProvider getLocalFileProvider() throws FileSystemException { if (localFileProvider == null) { throw new FileSystemException( "vfs.impl/no-local-file-provider.error"); } return localFileProvider; }