@Override public FileContent getContent() throws FileSystemException { return new DecoratedFileContent( super.getContent() ) { @Override public InputStream getInputStream() throws FileSystemException { return annotator.getInputStream( super.getInputStream(), annotationsFile.getContent().getInputStream() ); } }; } }
@Override public void close() throws FileSystemException { synchronized (this) { super.close(); } }
@Override public void copyFrom(final FileObject srcFile, final FileSelector selector) throws FileSystemException { synchronized (this) { super.copyFrom(srcFile, selector); } }
/** * Check if the given FileObject is instance of given class argument. * * @param fileObject The FileObject. * @param wantedClass The Class to check. * @return true if fileObject is an instance of the specified Class. * @throws FileSystemException if an error occurs. */ public static boolean isInstanceOf(final FileObject fileObject, final Class<?> wantedClass) throws FileSystemException { Object searchObject = fileObject; while (searchObject instanceof DecoratedFileObject) { if (wantedClass.isInstance(searchObject)) { return true; } searchObject = ((DecoratedFileObject) searchObject).getDecoratedFileObject(); } if (wantedClass.isInstance(searchObject)) { return true; } return false; } }
@Override public void findFiles(final FileSelector selector, final boolean depthwise, final List<FileObject> selected) throws FileSystemException { synchronized (this) { super.findFiles(selector, depthwise, selected); } }
@Override public int delete(final FileSelector selector) throws FileSystemException { synchronized (this) { return super.delete(selector); } }
@Override public FileObject getChild(final String name) throws FileSystemException { synchronized (this) { return super.getChild(name); } }
@Override public boolean exists() throws FileSystemException { synchronized (this) { return super.exists(); } }
@Override public void createFolder() throws FileSystemException { synchronized (this) { super.createFolder(); } }
@Override public void createFile() throws FileSystemException { synchronized (this) { super.createFile(); } }
/** * Check if the given FileObject is instance of given class argument. * * @param fileObject The FileObject. * @param wantedClass The Class to check. * @return true if fileObject is an instance of the specified Class. * @throws FileSystemException if an error occurs. */ public static boolean isInstanceOf(final FileObject fileObject, final Class<?> wantedClass) throws FileSystemException { Object searchObject = fileObject; while (searchObject instanceof DecoratedFileObject) { if (wantedClass.isInstance(searchObject)) { return true; } searchObject = ((DecoratedFileObject) searchObject).getDecoratedFileObject(); } if (wantedClass.isInstance(searchObject)) { return true; } return false; } }
@Override public FileObject[] findFiles(final FileSelector selector) throws FileSystemException { synchronized (this) { return super.findFiles(selector); } }
@Override public boolean delete() throws FileSystemException { synchronized (this) { return super.delete(); } }
@Override public FileObject getChild(final String name) throws FileSystemException { synchronized (this) { return super.getChild(name); } }
@Override public boolean exists() throws FileSystemException { synchronized (this) { return super.exists(); } }
@Override public void createFolder() throws FileSystemException { synchronized (this) { super.createFolder(); } }
@Override public void createFile() throws FileSystemException { synchronized (this) { super.createFile(); } }
@Override public FileContent getContent() throws FileSystemException { synchronized (this) { return super.getContent(); } }
/** * Check if the given FileObject is instance of given class argument. * * @param fileObject The FileObject. * @param wantedClass The Class to check. * @return true if fileObject is an instance of the specified Class. * @throws FileSystemException if an error occurs. */ public static boolean isInstanceOf(final FileObject fileObject, final Class<?> wantedClass) throws FileSystemException { Object searchObject = fileObject; while (searchObject instanceof DecoratedFileObject) { if (wantedClass.isInstance(searchObject)) { return true; } searchObject = ((DecoratedFileObject) searchObject).getDecoratedFileObject(); } if (wantedClass.isInstance(searchObject)) { return true; } return false; } }
@Override public FileObject[] findFiles(final FileSelector selector) throws FileSystemException { synchronized (this) { return super.findFiles(selector); } }