SortedSet<Entry> getEntries(final int pDirectoryId, final Entry pParent) throws IOException { return getEntriesRecursive(pDirectoryId, pParent, new TreeSet<Entry>()); }
private SortedSet<Entry> getEntriesRecursive(final int pDirectoryId, final Entry pParent, final SortedSet<Entry> pEntries) throws IOException { //System.out.println("pDirectoryId: " + pDirectoryId); Entry entry = getEntry(pDirectoryId, pParent); //System.out.println("entry: " + entry); if (!pEntries.add(entry)) { // TODO: This occurs in some Thumbs.db files, and Windows will // still parse the file gracefully somehow... // Deleting and regenerating the file will remove the cyclic // references, but... How can Windows parse this file? throw new CorruptDocumentException("Cyclic chain reference for entry: " + pDirectoryId); } if (entry.prevDId != FREE_SID) { //System.out.println("prevDId: " + entry.prevDId); getEntriesRecursive(entry.prevDId, pParent, pEntries); } if (entry.nextDId != FREE_SID) { //System.out.println("nextDId: " + entry.nextDId); getEntriesRecursive(entry.nextDId, pParent, pEntries); } return pEntries; }
SortedSet<Entry> getEntries(final int pDirectoryId, final Entry pParent) throws IOException { return getEntriesRecursive(pDirectoryId, pParent, new TreeSet<Entry>()); }
SortedSet<Entry> getEntries(final int pDirectoryId, final Entry pParent) throws IOException { return getEntriesRecursive(pDirectoryId, pParent, new TreeSet<Entry>()); }
private SortedSet<Entry> getEntriesRecursive(final int pDirectoryId, final Entry pParent, final SortedSet<Entry> pEntries) throws IOException { //System.out.println("pDirectoryId: " + pDirectoryId); Entry entry = getEntry(pDirectoryId, pParent); //System.out.println("entry: " + entry); if (!pEntries.add(entry)) { // TODO: This occurs in some Thumbs.db files, and Windows will // still parse the file gracefully somehow... // Deleting and regenerating the file will remove the cyclic // references, but... How can Windows parse this file? throw new CorruptDocumentException("Cyclic chain reference for entry: " + pDirectoryId); } if (entry.prevDId != FREE_SID) { //System.out.println("prevDId: " + entry.prevDId); getEntriesRecursive(entry.prevDId, pParent, pEntries); } if (entry.nextDId != FREE_SID) { //System.out.println("nextDId: " + entry.nextDId); getEntriesRecursive(entry.nextDId, pParent, pEntries); } return pEntries; }
private SortedSet<Entry> getEntriesRecursive(final int pDirectoryId, final Entry pParent, final SortedSet<Entry> pEntries) throws IOException { //System.out.println("pDirectoryId: " + pDirectoryId); Entry entry = getEntry(pDirectoryId, pParent); //System.out.println("entry: " + entry); if (!pEntries.add(entry)) { // TODO: This occurs in some Thumbs.db files, and Windows will // still parse the file gracefully somehow... // Deleting and regenerating the file will remove the cyclic // references, but... How can Windows parse this file? throw new CorruptDocumentException("Cyclic chain reference for entry: " + pDirectoryId); } if (entry.prevDId != FREE_SID) { //System.out.println("prevDId: " + entry.prevDId); getEntriesRecursive(entry.prevDId, pParent, pEntries); } if (entry.nextDId != FREE_SID) { //System.out.println("nextDId: " + entry.nextDId); getEntriesRecursive(entry.nextDId, pParent, pEntries); } return pEntries; }