Exemplo 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) {
     }
   }
 }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo n.º 4
0
 @Override
 public Long lastModified() {
   return ze.getTime();
 }
Exemplo n.º 5
0
 @Override
 public Boolean isFile() {
   return !ze.isDirectory();
 }
Exemplo n.º 6
0
 @Override
 public Boolean isDirectory() {
   return ze.isDirectory() || ze.getName().endsWith("/");
 }
Exemplo n.º 7
0
 @Override
 public String getDetails(boolean countHiddenChildren) {
   String ret = super.getDetails(countHiddenChildren);
   if (!isDirectory()) ret += " (" + OpenPath.formatSize(ze.getCompressedSize()) + ")";
   return ret;
 }
Exemplo n.º 8
0
 @Override
 public OpenPath[] listFiles() throws IOException {
   return OpenLZMA.this.listFiles(ze.getName());
 }
Exemplo n.º 9
0
 @Override
 public long length() {
   return ze.getSize();
 }
Exemplo n.º 10
0
 public String getRelativePath() {
   return ze.getName();
 }