use of com.mucommander.commons.file.FilePermissions in project mucommander by mucommander.
the class RWArchiveEntryFile method changePermissions.
@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 (// restore old permissions if attributes could not be updated
!success)
entry.setPermissions(oldPermissions);
if (!success)
throw new IOException();
}
Aggregations