Esempio n. 1
0
 public OpenLZMAEntry(OpenPath parent, SevenZipEntry entry) {
   mParent = parent;
   ze = entry;
   if (ze.getName().endsWith("/") || ze.isDirectory()) {
     try {
       mChildren = list();
     } catch (IOException e) {
     }
   }
 }
Esempio n. 2
0
 @Override
 public String getName() {
   String name = ze.getName();
   if (name.endsWith("/")) name = name.substring(0, name.length() - 1);
   name = name.substring(name.lastIndexOf("/") + 1);
   return name;
 }
Esempio n. 3
0
 public List<OpenLZMAEntry> getAllEntries() throws IOException {
   if (mEntries != null) return mEntries;
   mEntries = new ArrayList<OpenLZMAEntry>();
   for (int i = 0; i < mLZMA.size(); i++) {
     SevenZipEntry ze = mLZMA.getEntry(i);
     if (ze.isDirectory()) continue;
     String parent = ze.getName();
     if (parent.indexOf("/") > 0 && parent.indexOf("/") < parent.length() - 1)
       parent = parent.substring(0, parent.lastIndexOf("/") + 1);
     else parent = "";
     OpenPath vp = findVirtualPath(parent);
     OpenLZMAEntry entry = new OpenLZMAEntry(vp, ze);
     mEntries.add(entry);
     addFamilyEntry(parent, entry);
   }
   Set<String> keys = mFamily.keySet();
   for (String path : keys.toArray(new String[keys.size()])) {
     if (path.equals("")) continue;
     addFamilyPath(path);
   }
   return mEntries;
 }
Esempio n. 4
0
 @Override
 public Long lastModified() {
   return ze.getTime();
 }
Esempio n. 5
0
 @Override
 public Boolean isFile() {
   return !ze.isDirectory();
 }
Esempio n. 6
0
 @Override
 public Boolean isDirectory() {
   return ze.isDirectory() || ze.getName().endsWith("/");
 }
Esempio n. 7
0
 @Override
 public String getDetails(boolean countHiddenChildren) {
   String ret = super.getDetails(countHiddenChildren);
   if (!isDirectory()) ret += " (" + OpenPath.formatSize(ze.getCompressedSize()) + ")";
   return ret;
 }
Esempio n. 8
0
 @Override
 public OpenPath[] listFiles() throws IOException {
   return OpenLZMA.this.listFiles(ze.getName());
 }
Esempio n. 9
0
 @Override
 public long length() {
   return ze.getSize();
 }
Esempio n. 10
0
 public String getRelativePath() {
   return ze.getName();
 }