/** * @throws IOException if the entry does not exist within the archive */ @Override public void changeDate(long lastModified) throws IOException, UnsupportedFileOperationException { if(!entry.exists()) throw new IOException(); long oldDate = entry.getDate(); entry.setDate(lastModified); boolean success = updateEntryAttributes(); if(!success) { // restore old date if attributes could not be updated entry.setDate(oldDate); throw new IOException(); } }
?new RWArchiveEntryFile( entryURL, this,
if(entry.exists()) { try { delete();
if(isDirectory()) { ArchiveEntryTree tree = rwArchiveFile.getArchiveEntryTree(); if(tree!=null) {
@Override public void changePermissions(int permissions) throws IOException { if(!entry.exists()) throw new IOException(); FilePermissions oldPermissions = entry.getPermissions(); FilePermissions newPermissions = new SimpleFilePermissions(permissions, oldPermissions.getMask()); entry.setPermissions(newPermissions); boolean success = updateEntryAttributes(); if(!success) // restore old permissions if attributes could not be updated entry.setPermissions(oldPermissions); if(!success) throw new IOException(); } }