Package org.jnode.fs.ntfs.attribute

Examples of org.jnode.fs.ntfs.attribute.AttributeListEntry


        @Override
        public NTFSAttribute next() {
            Set<Integer> encounteredIds = new HashSet<Integer>();

            while (entryIterator.hasNext()) {
                AttributeListEntry entry = entryIterator.next();

                // Sanity check - ensure we don't hit the same ID more than once
                int attributeId = entry.getAttributeID();
                if (encounteredIds.contains(attributeId)) {
                    throw new IllegalStateException("Hit the same attribute ID more than once, aborting. ref = 0x" +
                        Long.toHexString(entry.getFileReferenceNumber()) + " id=" + attributeId);
                }

                encounteredIds.add(attributeId);

                try {
                    // If it's resident (i.e. in the current file record) then we don't need to
                    // look it up, and doing so would risk infinite recursion.
                    FileRecord holdingRecord;
                    if (entry.getFileReferenceNumber() == referenceNumber) {
                        holdingRecord = FileRecord.this;
                    } else {
                        log.debug("Looking up MFT entry for: " + entry.getFileReferenceNumber());
                        holdingRecord = getVolume().getMFT().getRecord(entry.getFileReferenceNumber());
                    }

                    NTFSAttribute attribute = holdingRecord.findStoredAttributeByID(entry.getAttributeID());
                    log.debug("Attribute: " + attribute);
                    return attribute;
                } catch (IOException e) {
                    throw new IllegalStateException("Error getting MFT or FileRecord for attribute in list, ref = 0x" +
                        Long.toHexString(entry.getFileReferenceNumber()), e);
                }
            }

            return null;
        }
View Full Code Here

TOP

Related Classes of org.jnode.fs.ntfs.attribute.AttributeListEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.