@Override public long getDate() { return entry.getDate(); }
/** * @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(); } }
childNode = new DefaultMutableTreeNode(new ArchiveEntry(subPath, true, entry.getDate(), 0, true), true); node.add(childNode); node = childNode;
@Override public void updateEntry(ArchiveEntry entry) throws IOException, UnsupportedFileOperationException { ZipEntry zipEntry = (com.mucommander.commons.file.archive.zip.provider.ZipEntry)entry.getEntryObject(); // Most of the time, the ZipEntry will not be null. However, it can be null in some rare cases, when directory // entries have been created in the entries tree but don't exist in the Zip file. // That is the case when a file entry exists in the Zip file but has no directory entry for the parent. if(zipEntry!=null) { // Entry exists physically in the zip file checkZipFile(); zipEntry.setTime(entry.getDate()); zipEntry.setUnixMode(entry.getPermissions().getIntValue()); // Physically update the entry's attributes in the Zip file zipFile.updateEntry(zipEntry); // Declare the zip file and entries tree up-to-date declareZipFileUpToDate(); declareEntriesTreeUpToDate(); } }