checkZipFile(); ZipEntry zipEntry = (com.mucommander.commons.file.archive.zip.provider.ZipEntry)entry.getEntryObject(); if(zipEntry==null) // Should not normally happen throw new IOException();
TarEntry tarEntry = (TarEntry)entry.getEntryObject(); if(tarEntry!=null) { TarInputStream tin = createTarStream(tarEntry.getOffset());
@Override public synchronized void deleteEntry(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(); // Delete the entry from the zip file (physically) zipFile.deleteEntry(zipEntry); // Remove the ZipEntry object from the AchiveEntry entry.setEntryObject(null); // Declare the zip file and entries tree up-to-date declareZipFileUpToDate(); declareEntriesTreeUpToDate(); } // Else entry doesn't physically exist in the zip file, only in the entries tree // Remove the entry from the entries tree removeFromEntriesTree(entry); }
@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(); } }