/** * Always throws an {@link UnsupportedFileOperationException} when called. * * @throws UnsupportedFileOperationException always */ @Override @UnsupportedFileOperation public void copyRemotelyTo(AbstractFile destFile) throws UnsupportedFileOperationException { // TODO: we could consider adding remote copy support to RWArchiveEntryFile throw new UnsupportedFileOperationException(FileOperation.COPY_REMOTELY); }
@Override public AbstractFile getParent() { if(!getParentSet) { getParent = file.getParent(); // Create a CachedFile instance around the file if recursion is enabled if(recurseInstances && getParent!=null) getParent = new CachedFile(getParent, true); getParentSet = true; } return getParent; }
@Override public AbstractFile[] ls() throws IOException, UnsupportedFileOperationException { // Don't cache ls() result but create a CachedFile instance around each of the files if recursion is enabled AbstractFile files[] = file.ls(); if(recurseInstances) return createCachedFiles(files); return files; }
/** * Overridden to trigger attributes update if the expiration date has been reached. */ @Override public String getOwner() { checkForExpiration(false); return super.getOwner(); }
/** * Verifies that the given {@link UnsupportedFileOperationException} is not <code>null</code> and that its * associated file operation matches the given one. * * @param e the {@link UnsupportedFileOperationException} to check * @param expectedFileOperation the expected file operation */ protected void assertUnsupportedFileOperationException(UnsupportedFileOperationException e, FileOperation expectedFileOperation) { assert e != null; assert expectedFileOperation.equals(e.getFileOperation()); }
/** * Always throws an {@link UnsupportedFileOperationException}: HTTP files are read-only. * * @throws UnsupportedFileOperationException always */ @Override @UnsupportedFileOperation public OutputStream getAppendOutputStream() throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.APPEND_FILE); }
/** * Always throws an {@link UnsupportedFileOperationException}. */ @Override @UnsupportedFileOperation public RandomAccessInputStream getRandomAccessInputStream() throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.RANDOM_READ_FILE); }
/** * Always throws an {@link UnsupportedFileOperationException}. */ @Override @UnsupportedFileOperation public void delete() throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.DELETE); }
@Override @UnsupportedFileOperation public void copyRemotelyTo(AbstractFile destFile) throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.COPY_REMOTELY); }
@Override @UnsupportedFileOperation public void copyRemotelyTo(AbstractFile destFile) throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.COPY_REMOTELY); }
@Override @UnsupportedFileOperation public OutputStream getAppendOutputStream() throws IOException, UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.APPEND_FILE); }
@Override @UnsupportedFileOperation public RandomAccessInputStream getRandomAccessInputStream() throws IOException, UnsupportedFileOperationException { throw new UnsupportedFileOperationException( FileOperation.RANDOM_READ_FILE); }
@Override @UnsupportedFileOperation public void changePermission(PermissionAccess access, PermissionType permission, boolean enabled) throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.CHANGE_PERMISSION); }
@Override @UnsupportedFileOperation public long getFreeSpace() throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.GET_FREE_SPACE); }
@Override @UnsupportedFileOperation public void changeDate(long lastModified) throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.CHANGE_DATE); } }
/** * Implementation notes: always throws an {@link UnsupportedFileOperationException}. * * @throws UnsupportedFileOperationException always */ @Override @UnsupportedFileOperation public InputStream getInputStream() throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.READ_FILE); }
/** * Always throws {@link UnsupportedFileOperationException} when called. * * @throws UnsupportedFileOperationException, always */ @Override @UnsupportedFileOperation public long getTotalSpace() throws UnsupportedFileOperationException { throw new UnsupportedFileOperationException(FileOperation.GET_TOTAL_SPACE); }
@Override @UnsupportedFileOperation public void changePermission(PermissionAccess access, PermissionType permission, boolean enabled) throws UnsupportedFileOperationException { // XFile has no method for that unfortunately throw new UnsupportedFileOperationException(FileOperation.CHANGE_PERMISSION); }