use of com.mucommander.commons.file.archive.SingleArchiveEntryIterator in project mucommander by mucommander.
the class Bzip2ArchiveFile method getEntryIterator.
// //////////////////////////////////////
// AbstractArchiveFile implementation //
// //////////////////////////////////////
@Override
public ArchiveEntryIterator getEntryIterator() throws IOException {
String extension = getCustomExtension() != null ? getCustomExtension() : getExtension();
String name = getName();
if (extension != null) {
// Remove the 'bz2' or 'tbz2' extension from the entry's name
extension = extension.toLowerCase();
int extensionIndex = name.toLowerCase().lastIndexOf("." + extension);
if (extensionIndex > -1)
name = name.substring(0, extensionIndex);
if (extension.equals("tbz2") || extension.equals("tar.bz2"))
name += ".tar";
}
return new SingleArchiveEntryIterator(new ArchiveEntry("/" + name, false, getDate(), -1, true));
}
use of com.mucommander.commons.file.archive.SingleArchiveEntryIterator in project mucommander by mucommander.
the class GzipArchiveFile method getEntryIterator.
// //////////////////////////////////////
// AbstractArchiveFile implementation //
// //////////////////////////////////////
@Override
public ArchiveEntryIterator getEntryIterator() throws IOException {
String extension = getCustomExtension() != null ? getCustomExtension() : getExtension();
String name = getName();
if (extension != null) {
// Remove the 'gz' or 'tgz' extension from the entry's name
extension = extension.toLowerCase();
int extensionIndex = name.toLowerCase().lastIndexOf("." + extension);
if (extensionIndex > -1)
name = name.substring(0, extensionIndex);
if (extension.equals("tgz") || extension.equals("tar.gz"))
name += ".tar";
}
return new SingleArchiveEntryIterator(new ArchiveEntry("/" + name, false, getDate(), -1, true));
}
use of com.mucommander.commons.file.archive.SingleArchiveEntryIterator in project mucommander by mucommander.
the class XzArchiveFile method getEntryIterator.
// //////////////////////////////////////
// AbstractArchiveFile implementation //
// //////////////////////////////////////
@Override
public ArchiveEntryIterator getEntryIterator() throws IOException {
String extension = getCustomExtension() != null ? getCustomExtension() : getExtension();
String name = getName();
if (extension != null) {
// Remove the 'xz' or 'txz' extension from the entry's name
extension = extension.toLowerCase();
int extensionIndex = name.toLowerCase().lastIndexOf("." + extension);
if (extensionIndex > -1)
name = name.substring(0, extensionIndex);
if (extension.equals("txz") || extension.equals("tar.xz"))
name += ".tar";
}
return new SingleArchiveEntryIterator(new ArchiveEntry("/" + name, false, getDate(), -1, true));
}
Aggregations