Continued working on the decoding of DMG images.
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/d0cef423 Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/d0cef423 Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/d0cef423 Branch: refs/heads/feature/flash-downloader Commit: d0cef423715970e7ea624340e7e3371f18934312 Parents: 0b6dfdd ee771e6 Author: Christofer Dutz <christofer.d...@codecentric.de> Authored: Tue Apr 18 14:14:58 2017 +0200 Committer: Christofer Dutz <christofer.d...@codecentric.de> Committed: Tue Apr 18 14:14:58 2017 +0200 ---------------------------------------------------------------------- .../spelling/ISpellingContainerController.as | 7 + .../spelling/SpellingContextMenuForTLF.as | 7 +- .../SquigglyCustomContainerController.as | 6 +- .../src/org/apache/flex/ant/tags/Exec.as | 12 + .../src/org/apache/flex/ant/tags/Replace.as | 5 + .../utilities/converter/air/AirConverter.java | 66 +++- .../flex-sdk-converter/converters/base/pom.xml | 16 + .../flex/utilities/converter/BaseConverter.java | 58 ++-- .../base/src/main/resources/logback.xml | 16 + .../utilities/converter/flex/FlexConverter.java | 8 +- .../deployer/aether/AetherDeployer.java | 26 +- .../converter/retrievers/BaseRetriever.java | 41 ++- .../retrievers/download/DownloadRetriever.java | 210 ++++++++----- .../download/utils/utils/DmgBlkxBlock.java | 125 ++++++++ .../utils/utils/DmgPropertyListMishBlock.java | 109 ------- .../download/utils/utils/HFSPlusExtent.java | 40 --- .../download/utils/utils/HFSPlusForkData.java | 58 ---- .../utils/utils/HFSPlusVolumeHeader.java | 217 ------------- .../download/utils/utils/HFSVolumeHeader.java | 13 - .../utils/utils/btree/BTreeDescriptor.java | 99 ++++++ .../utils/utils/btree/BTreeHeaderNode.java | 55 ++++ .../utils/utils/btree/BTreeHeaderRecord.java | 168 ++++++++++ .../utils/utils/btree/BTreeIndexNode.java | 36 +++ .../utils/utils/btree/BTreeLeafNode.java | 36 +++ .../utils/utils/btree/BTreeMapNode.java | 36 +++ .../utils/utils/btree/BTreeMapRecord.java | 29 ++ .../download/utils/utils/btree/BTreeNode.java | 42 +++ .../utils/utils/btree/BTreeUserDataRecord.java | 28 ++ .../utils/utils/hfs/HFSVolumeHeader.java | 29 ++ .../utils/utils/hfsplus/HFSPlusExtent.java | 56 ++++ .../utils/utils/hfsplus/HFSPlusFinderInfo.java | 72 +++++ .../utils/utils/hfsplus/HFSPlusForkData.java | 74 +++++ .../utils/hfsplus/HFSPlusVolumeHeader.java | 311 +++++++++++++++++++ .../utils/utils/hfsx/HFSXVolumeHeader.java | 29 ++ npm-flexjs/dependencies/ApacheFalcon.js | 12 +- 35 files changed, 1560 insertions(+), 592 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/DmgBlkxBlock.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/DmgBlkxBlock.java index 0000000,0000000..5bb6bdf new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/DmgBlkxBlock.java @@@ -1,0 -1,0 +1,125 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils; ++ ++import java.io.ByteArrayInputStream; ++import java.io.DataInputStream; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.List; ++ ++/** ++ * Created by christoferdutz on 25.02.16. ++ */ ++public class DmgPropertyListMishBlock { ++ ++ private String blockName; ++ ++ private int version; // Current version is 1 ++ private long sectorNumber; // Starting disk sector in this blkx descriptor ++ private long sectorCount; // Number of disk sectors in this blkx descriptor ++ ++ private long dataOffset; ++ private int buffersNeeded; ++ private int blockDescriptors; // Number of descriptors ++ ++ private DmgUdifChecksum checksum; ++ ++ private List<DmgBlockChunkEntry> blockChunkEntries; ++ ++ public DmgPropertyListMishBlock(String blockName, byte[] data) { ++ this.blockName = blockName; ++ ++ // Initialize the fields by parsing the input bytes. ++ ByteArrayInputStream bis = new ByteArrayInputStream(data); ++ DataInputStream dis = new DataInputStream(bis); ++ try { ++ dis.readInt(); ++ version = dis.readInt(); ++ sectorNumber = dis.readLong(); ++ sectorCount = dis.readLong(); ++ dataOffset = dis.readLong(); ++ buffersNeeded = dis.readInt(); ++ blockDescriptors = dis.readInt(); ++ dis.skipBytes(24); ++ byte[] checksumData = new byte[136]; ++ int bytesRead = dis.read(checksumData, 0, 136); ++ if(bytesRead != 136) { ++ throw new IllegalArgumentException( ++ "Invalid DmgPropertyListMishBlock data. Expected to read 136 bytes for 'checksum'"); ++ } ++ checksum = new DmgUdifChecksum(checksumData); ++ int numberOfBlockChunks = dis.readInt(); ++ ++ blockChunkEntries = new ArrayList<DmgBlockChunkEntry>(); ++ byte[] blockChunkData = new byte[40]; ++ for(int i = 0; i < numberOfBlockChunks; i++) { ++ bytesRead = dis.read(blockChunkData); ++ if(bytesRead != 40) { ++ throw new IllegalArgumentException( ++ "Invalid DmgPropertyListMishBlock data. Expected to read 40 bytes for 'dmg block chunk data'"); ++ } ++ DmgBlockChunkEntry entry = new DmgBlockChunkEntry(blockChunkData); ++ // The block with the type "0xFFFFFFFF" is the end-block and contains ++ // no data we could need, so we simply end here. ++ if(entry.getEntryType() == 0xFFFFFFFF) { ++ break; ++ } ++ blockChunkEntries.add(entry); ++ } ++ } catch (IOException e) { ++ throw new IllegalArgumentException("Invalid DmgPropertyListMishBlock data."); ++ } ++ } ++ ++ public String getBlockName() { ++ return blockName; ++ } ++ ++ public int getVersion() { ++ return version; ++ } ++ ++ public long getSectorNumber() { ++ return sectorNumber; ++ } ++ ++ public long getSectorCount() { ++ return sectorCount; ++ } ++ ++ public long getDataOffset() { ++ return dataOffset; ++ } ++ ++ public int getBuffersNeeded() { ++ return buffersNeeded; ++ } ++ ++ public int getBlockDescriptors() { ++ return blockDescriptors; ++ } ++ ++ public DmgUdifChecksum getChecksum() { ++ return checksum; ++ } ++ ++ public List<DmgBlockChunkEntry> getBlockChunkEntries() { ++ return blockChunkEntries; ++ } ++ ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeDescriptor.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeDescriptor.java index 0000000,0000000..d749865 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeDescriptor.java @@@ -1,0 -1,0 +1,99 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++import java.io.DataInputStream; ++import java.io.IOException; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeDescriptor { ++ ++ private int fLink; ++ private int bLink; ++ private BTreeNodeType kind; ++ private byte height; ++ private short numRecords; ++ ++ public HFSPlusBTreeDescriptor(DataInputStream dis) { ++ try { ++ fLink = dis.readInt(); ++ bLink = dis.readInt(); ++ switch(dis.readByte()) { ++ case -1: ++ kind = BTreeNodeType.LEAF_NODE; ++ break; ++ case 0: ++ kind = BTreeNodeType.INDEX_NODE; ++ break; ++ case 1: ++ kind = BTreeNodeType.HEADER_NODE; ++ break; ++ case 2: ++ kind = BTreeNodeType.MAP_NODE; ++ break; ++ default: ++ throw new IllegalArgumentException("Invalid HFSPlusBTreeDescriptor data. Unknown node type."); ++ } ++ height = dis.readByte(); ++ numRecords = dis.readShort(); ++ dis.readShort(); ++ } catch (IOException e) { ++ throw new IllegalArgumentException("Invalid HFSPlusBTreeDescriptor data."); ++ } ++ } ++ ++ public int getfLink() { ++ return fLink; ++ } ++ ++ public int getbLink() { ++ return bLink; ++ } ++ ++ public BTreeNodeType getKind() { ++ return kind; ++ } ++ ++ public byte getHeight() { ++ return height; ++ } ++ ++ public short getNumRecords() { ++ return numRecords; ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeDescriptor{" + ++ "fLink=" + fLink + ++ ", bLink=" + bLink + ++ ", kind=" + kind + ++ ", height=" + height + ++ ", numRecords=" + numRecords + ++ '}'; ++ } ++ ++ public enum BTreeNodeType { ++ LEAF_NODE, ++ INDEX_NODE, ++ HEADER_NODE, ++ MAP_NODE ++ } ++ ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeHeaderNode.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeHeaderNode.java index 0000000,0000000..002a03b new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeHeaderNode.java @@@ -1,0 -1,0 +1,55 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++import java.io.DataInputStream; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeHeaderNode extends HFSPlusBTreeNode { ++ ++ private HFSPlusBTreeHeaderRecord headerRecord; ++ private HFSPlusBTreeUserDataRecord userDataRecord; ++ private HFSPlusBTreeMapRecord mapRecord; ++ ++ public HFSPlusBTreeHeaderNode(DataInputStream dis) { ++ super(dis); ++ } ++ ++ public HFSPlusBTreeHeaderRecord getHeaderRecord() { ++ return headerRecord; ++ } ++ ++ public HFSPlusBTreeUserDataRecord getUserDataRecord() { ++ return userDataRecord; ++ } ++ ++ public HFSPlusBTreeMapRecord getMapRecord() { ++ return mapRecord; ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeHeaderNode{" + ++ super.toString() + ++ "headerRecord=" + headerRecord + ++ ", userDataRecord=" + userDataRecord + ++ ", mapRecord=" + mapRecord + ++ '}'; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeHeaderRecord.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeHeaderRecord.java index 0000000,0000000..ca1b234 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeHeaderRecord.java @@@ -1,0 -1,0 +1,168 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++import java.io.DataInputStream; ++import java.io.IOException; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeHeaderRecord { ++ ++ private short treeDepth; ++ private int rootNode; ++ private int leafRecords; ++ private int firstLeafNode; ++ private int lastLeafNode; ++ private short nodeSize; ++ private short maxKeyLength; ++ private int totalNodes; ++ private int freeNodes; ++ //private short reserved1; ++ private int clumpSize; ++ private byte btreeType; ++ private byte keyCompareType; ++ private int attributes; ++ //private int reserved3[16]; ++ ++ public HFSPlusBTreeHeaderRecord(DataInputStream dis) { ++ try { ++ treeDepth = dis.readShort(); ++ rootNode = dis.readInt(); ++ leafRecords = dis.readInt(); ++ firstLeafNode = dis.readInt(); ++ lastLeafNode = dis.readInt(); ++ nodeSize = dis.readShort(); ++ maxKeyLength = dis.readShort(); ++ totalNodes = dis.readInt(); ++ freeNodes = dis.readInt(); ++ dis.readShort(); ++ clumpSize = dis.readInt(); ++ btreeType = dis.readByte(); ++ keyCompareType = dis.readByte(); ++ attributes = dis.readInt(); ++ // read 16 bytes ... ++ if(dis.read(new byte[16]) != 16) { ++ throw new IllegalArgumentException("Invalid HFSPlusBTreeHeaderRecord data."); ++ } ++ } catch (IOException e) { ++ throw new IllegalArgumentException("Invalid HFSPlusBTreeHeaderRecord data."); ++ } ++ } ++ ++ /** ++ * @return The current depth of the B-tree. Always equal to the height field of the root node. ++ */ ++ public short getTreeDepth() { ++ return treeDepth; ++ } ++ ++ /** ++ * @return The node number of the root node, the index node that acts as the root of the B-tree. ++ */ ++ public int getRootNode() { ++ return rootNode; ++ } ++ ++ /** ++ * @return The total number of records contained in all of the leaf nodes. ++ */ ++ public int getLeafRecords() { ++ return leafRecords; ++ } ++ ++ /** ++ * @return The node number of the first leaf node. This may be zero if there are no leaf nodes. ++ */ ++ public int getFirstLeafNode() { ++ return firstLeafNode; ++ } ++ ++ /** ++ * @return The node number of the last leaf node. This may be zero if there are no leaf nodes. ++ */ ++ public int getLastLeafNode() { ++ return lastLeafNode; ++ } ++ ++ /** ++ * @return The size, in bytes, of a node. This is a power of two, from 512 through 32,768, inclusive. ++ */ ++ public short getNodeSize() { ++ return nodeSize; ++ } ++ ++ /** ++ * @return The maximum length of a key in an index or leaf node. ++ */ ++ public short getMaxKeyLength() { ++ return maxKeyLength; ++ } ++ ++ /** ++ * @return The total number of nodes (be they free or used) in the B-tree. ++ */ ++ public int getTotalNodes() { ++ return totalNodes; ++ } ++ ++ /** ++ * @return The number of unused nodes in the B-tree. ++ */ ++ public int getFreeNodes() { ++ return freeNodes; ++ } ++ ++ /** ++ * @return clumpSize ++ */ ++ public int getClumpSize() { ++ return clumpSize; ++ } ++ ++ public byte getBtreeType() { ++ return btreeType; ++ } ++ ++ public byte getKeyCompareType() { ++ return keyCompareType; ++ } ++ ++ public int getAttributes() { ++ return attributes; ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeHeaderRecord{" + ++ "treeDepth=" + treeDepth + ++ ", rootNode=" + rootNode + ++ ", leafRecords=" + leafRecords + ++ ", firstLeafNode=" + firstLeafNode + ++ ", lastLeafNode=" + lastLeafNode + ++ ", nodeSize=" + nodeSize + ++ ", maxKeyLength=" + maxKeyLength + ++ ", totalNodes=" + totalNodes + ++ ", freeNodes=" + freeNodes + ++ ", clumpSize=" + clumpSize + ++ ", btreeType=" + btreeType + ++ ", keyCompareType=" + keyCompareType + ++ ", attributes=" + attributes + ++ '}'; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeIndexNode.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeIndexNode.java index 0000000,0000000..ca25cc2 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeIndexNode.java @@@ -1,0 -1,0 +1,36 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++import java.io.DataInputStream; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeIndexNode extends HFSPlusBTreeNode { ++ ++ public HFSPlusBTreeIndexNode(DataInputStream dis) { ++ super(dis); ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeIndexNode{" + ++ super.toString() + ++ "}"; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeLeafNode.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeLeafNode.java index 0000000,0000000..b413ab4 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeLeafNode.java @@@ -1,0 -1,0 +1,36 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++import java.io.DataInputStream; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeLeafNode extends HFSPlusBTreeNode { ++ ++ public HFSPlusBTreeLeafNode(DataInputStream dis) { ++ super(dis); ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeLeafNode{" + ++ super.toString() + ++ "}"; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeMapNode.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeMapNode.java index 0000000,0000000..55dad9d new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeMapNode.java @@@ -1,0 -1,0 +1,36 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++import java.io.DataInputStream; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeMapNode extends HFSPlusBTreeNode { ++ ++ public HFSPlusBTreeMapNode(DataInputStream dis) { ++ super(dis); ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeMapNode{" + ++ super.toString() + ++ "}"; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeMapRecord.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeMapRecord.java index 0000000,0000000..8d6c90e new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeMapRecord.java @@@ -1,0 -1,0 +1,29 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeMapRecord { ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeMapRecord{}"; ++ } ++ ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeNode.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeNode.java index 0000000,0000000..4a0e52a new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeNode.java @@@ -1,0 -1,0 +1,42 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++import java.io.DataInputStream; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public abstract class HFSPlusBTreeNode { ++ ++ private HFSPlusBTreeDescriptor nodeDescriptor; ++ ++ public HFSPlusBTreeNode(DataInputStream dis) { ++ this.nodeDescriptor = new HFSPlusBTreeDescriptor(dis); ++ } ++ ++ public HFSPlusBTreeDescriptor getNodeDescriptor() { ++ return nodeDescriptor; ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeNode{" + ++ "nodeDescriptor=" + nodeDescriptor + ++ '}'; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeUserDataRecord.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeUserDataRecord.java index 0000000,0000000..0b7d69f new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/btree/BTreeUserDataRecord.java @@@ -1,0 -1,0 +1,28 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils.btree; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusBTreeUserDataRecord { ++ ++ @Override ++ public String toString() { ++ return "HFSPlusBTreeUserDataRecord{}"; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfs/HFSVolumeHeader.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfs/HFSVolumeHeader.java index 0000000,0000000..0895fcd new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfs/HFSVolumeHeader.java @@@ -1,0 -1,0 +1,29 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils; ++ ++import java.io.DataInputStream; ++ ++/** ++ * Created by christoferdutz on 27.02.16. ++ */ ++public class HFSVolumeHeader implements IHFSVolumeHeader { ++ ++ public HFSVolumeHeader(DataInputStream dis) { ++ } ++ ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusExtent.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusExtent.java index 0000000,0000000..d8136e1 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusExtent.java @@@ -1,0 -1,0 +1,56 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils; ++ ++import java.io.DataInputStream; ++import java.io.IOException; ++import java.util.ArrayList; ++ ++/** ++ * Created by christoferdutz on 27.02.16. ++ */ ++public class HFSPlusExtent { ++ ++ private int startBlock; ++ private int blockCount; ++ ++ public HFSPlusExtent(DataInputStream dis) { ++ try { ++ startBlock = dis.readInt(); ++ blockCount = dis.readInt(); ++ } catch (IOException e) { ++ throw new IllegalArgumentException("Invalid HFSPlusVolumeHeader data."); ++ } ++ } ++ ++ public int getStartBlock() { ++ return startBlock; ++ } ++ ++ public int getBlockCount() { ++ return blockCount; ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusExtent{" + ++ "startBlock=" + startBlock + ++ ", blockCount=" + blockCount + ++ '}'; ++ } ++ ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusFinderInfo.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusFinderInfo.java index 0000000,0000000..6a0a188 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusFinderInfo.java @@@ -1,0 -1,0 +1,72 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils; ++ ++import java.io.DataInputStream; ++import java.io.IOException; ++ ++/** ++ * Created by christoferdutz on 15.04.17. ++ */ ++public class HFSPlusFinderInfo { ++ ++ private int bootableSystemDirectoryId; ++ private int startupApplicationParentDirectoryId; ++ private int onMountOpenDirectoryId; ++ private int bootableMacOs8Or9SystemDirectoryId; ++ private int bootableMacOsXSystemDirectoryId; ++ private long uniqueVolumeIdentifyer; ++ ++ public HFSPlusFinderInfo(DataInputStream dis) { ++ try { ++ bootableSystemDirectoryId = dis.readInt(); ++ startupApplicationParentDirectoryId = dis.readInt(); ++ onMountOpenDirectoryId = dis.readInt(); ++ bootableMacOs8Or9SystemDirectoryId = dis.readInt(); ++ dis.readInt(); ++ bootableMacOsXSystemDirectoryId = dis.readInt(); ++ uniqueVolumeIdentifyer = dis.readLong(); ++ } catch (IOException e) { ++ throw new IllegalArgumentException("Invalid HFSPlusVolumeHeader data."); ++ } ++ } ++ ++ public int getBootableSystemDirectoryId() { ++ return bootableSystemDirectoryId; ++ } ++ ++ public int getStartupApplicationParentDirectoryId() { ++ return startupApplicationParentDirectoryId; ++ } ++ ++ public int getOnMountOpenDirectoryId() { ++ return onMountOpenDirectoryId; ++ } ++ ++ public int getBootableMacOs8Or9SystemDirectoryId() { ++ return bootableMacOs8Or9SystemDirectoryId; ++ } ++ ++ public int getBootableMacOsXSystemDirectoryId() { ++ return bootableMacOsXSystemDirectoryId; ++ } ++ ++ public long getUniqueVolumeIdentifyer() { ++ return uniqueVolumeIdentifyer; ++ } ++ ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusForkData.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusForkData.java index 0000000,0000000..ae67f34 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusForkData.java @@@ -1,0 -1,0 +1,74 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils; ++ ++import java.io.DataInputStream; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.List; ++ ++/** ++ * Created by christoferdutz on 26.02.16. ++ */ ++public class HFSPlusForkData { ++ ++ private long logicalSize; ++ private int clumpSize; ++ private int totalBlocks; ++ private List<HFSPlusExtent> extents; ++ ++ public HFSPlusForkData(DataInputStream dis) { ++ try { ++ logicalSize = dis.readLong(); ++ clumpSize = dis.readInt(); ++ totalBlocks = dis.readInt(); ++ extents = new ArrayList<HFSPlusExtent>(8); ++ for(int i = 0; i < 8; i++) { ++ HFSPlusExtent extent = new HFSPlusExtent(dis); ++ extents.add(extent); ++ } ++ } catch (IOException e) { ++ throw new IllegalArgumentException("Invalid HFSPlusVolumeHeader data."); ++ } ++ } ++ ++ public long getLogicalSize() { ++ return logicalSize; ++ } ++ ++ public int getClumpSize() { ++ return clumpSize; ++ } ++ ++ public int getTotalBlocks() { ++ return totalBlocks; ++ } ++ ++ public List<HFSPlusExtent> getExtents() { ++ return extents; ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusForkData{" + ++ "logicalSize=" + logicalSize + ++ ", clumpSize=" + clumpSize + ++ ", totalBlocks=" + totalBlocks + ++ ", extents=" + extents + ++ '}'; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusVolumeHeader.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusVolumeHeader.java index 0000000,0000000..6e23de0 new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsplus/HFSPlusVolumeHeader.java @@@ -1,0 -1,0 +1,311 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils; ++ ++import java.io.DataInputStream; ++import java.io.IOException; ++import java.util.Arrays; ++import java.util.Date; ++ ++/** ++ * http://www.dubeyko.com/development/FileSystems/HFSPLUS/hexdumps/hfsplus_volume_header.html ++ * http://dubeiko.com/development/FileSystems/HFSPLUS/tn1150.html ++ * http://dubeyko.com/development/FileSystems/HFSPLUS/tn1150.html#CatalogFile ++ * ++ * Created by christoferdutz on 24.02.16. ++ */ ++public class HFSPlusVolumeHeader implements IHFSVolumeHeader { ++ ++ private static final int VOLUME_UNMOUNTED = 0x0100; ++ private static final int VOLUME_SPARED_BLOCKS = 0x0200; ++ private static final int VOLUME_NOCACHE_REQUIRED = 0x0400; ++ private static final int BOOT_VOLUME_INCONSISTENT = 0x0800; ++ private static final int CATALOG_NODE_IDS_REUSED = 0x1000; ++ private static final int VOLUME_JOURNALED = 0x2000; ++ private static final int VOLUME_SOFTWARE_LOCK= 0x8000; ++ ++ private static final long UNSIGNED_INT_BITS = 0xFFFFFFFFL; ++ private static final long CONVERT_MAC_TO_JAVA_TIME = 2082880800L; ++ ++ private short version; ++ private int attributes; ++ private int lastMountedVersion; ++ private int journalInfoBlock; ++ ++ private Date createDate; ++ private Date modifyDate; ++ private Date backupDate; ++ private Date checkedDate; ++ ++ private int fileCount; ++ private int folderCount; ++ ++ private int blockSize; ++ private int totalBlocks; ++ private int freeBlocks; ++ ++ private int nextAllocation; ++ private int rsrcClumpSize; ++ private int nextCatalogID; ++ private int dataClumpSize; ++ ++ private int writeCount; ++ private long encodingsBitmap; ++ ++ private HFSPlusFinderInfo finderInfo; ++ ++ private HFSPlusForkData allocationFile; ++ private HFSPlusForkData extentsFile; ++ private HFSPlusForkData catalogFile; ++ private HFSPlusForkData attributesFile; ++ private HFSPlusForkData startupFile; ++ ++ public HFSPlusVolumeHeader(DataInputStream dis) { ++ try { ++ version = dis.readShort(); ++ attributes = dis.readInt(); ++ lastMountedVersion = dis.readInt(); ++ journalInfoBlock = dis.readInt(); ++ ++ createDate = readMacDate(dis); ++ modifyDate = readMacDate(dis); ++ backupDate = readMacDate(dis); ++ checkedDate = readMacDate(dis); ++ ++ fileCount = dis.readInt(); ++ folderCount = dis.readInt(); ++ ++ blockSize = dis.readInt(); ++ totalBlocks = dis.readInt(); ++ freeBlocks = dis.readInt(); ++ ++ nextAllocation = dis.readInt(); ++ rsrcClumpSize = dis.readInt(); ++ dataClumpSize = dis.readInt(); ++ nextCatalogID = dis.readInt(); ++ ++ writeCount = dis.readInt(); ++ encodingsBitmap = dis.readLong(); ++ ++ finderInfo = new HFSPlusFinderInfo(dis); ++ ++ allocationFile = new HFSPlusForkData(dis); ++ extentsFile = new HFSPlusForkData(dis); ++ catalogFile = new HFSPlusForkData(dis); ++ attributesFile = new HFSPlusForkData(dis); ++ startupFile = new HFSPlusForkData(dis); ++ } catch (IOException e) { ++ throw new IllegalArgumentException("Invalid HFSPlusVolumeHeader data."); ++ } ++ } ++ ++ public short getVersion() { ++ return version; ++ } ++ ++ public int getAttributes() { ++ return attributes; ++ } ++ ++ /** ++ * @return true if the volume was correctly flushed before being unmounted or ejected. ++ */ ++ public boolean isVolumeUnmounted() { ++ return (attributes & VOLUME_UNMOUNTED) != 0; ++ } ++ ++ /** ++ * @return true if there are any records in the extents overflow file for bad blocks ++ * (belonging to file ID kHFSBadBlockFileID). ++ */ ++ public boolean isSparedBlocks() { ++ return (attributes & VOLUME_SPARED_BLOCKS) != 0; ++ } ++ ++ /** ++ * @return true if the blocks from this volume should not be cached. ++ */ ++ public boolean isNoCacheRequired() { ++ return (attributes & VOLUME_NOCACHE_REQUIRED) != 0; ++ } ++ ++ /** ++ * @return true if the volume was NOT correctly flushed before being unmounted or ejected. ++ */ ++ public boolean isBootVolumeInconsistent() { ++ return (attributes & BOOT_VOLUME_INCONSISTENT) != 0; ++ } ++ ++ /** ++ * @return true when the nextCatalogID field overflows 32 bits, forcing smaller catalog node ++ * IDs to be reused. When this bit is set, it is common (and not an error) for catalog records ++ * to exist with IDs greater than or equal to nextCatalogID. ++ */ ++ public boolean isCatalogIdsReused() { ++ return (attributes & CATALOG_NODE_IDS_REUSED) != 0; ++ } ++ ++ /** ++ * @return true if the volume has a journal.*2 ++ * ++ */ ++ public boolean isVolumeJournaled() { ++ return (attributes & VOLUME_JOURNALED) != 0; ++ } ++ ++ /** ++ * @return true if the volume is write-protected due to a software setting. Any implementations ++ * must refuse to write to a volume with this bit set. ++ */ ++ public boolean isVolumeSoftwareLocked() { ++ return (attributes & VOLUME_SOFTWARE_LOCK) != 0; ++ } ++ ++ public int getLastMountedVersion() { ++ return lastMountedVersion; ++ } ++ ++ public int getJournalInfoBlock() { ++ return journalInfoBlock; ++ } ++ ++ public Date getCreateDate() { ++ return createDate; ++ } ++ ++ public Date getModifyDate() { ++ return modifyDate; ++ } ++ ++ public Date getBackupDate() { ++ return backupDate; ++ } ++ ++ public Date getCheckedDate() { ++ return checkedDate; ++ } ++ ++ public int getFileCount() { ++ return fileCount; ++ } ++ ++ public int getFolderCount() { ++ return folderCount; ++ } ++ ++ public int getBlockSize() { ++ return blockSize; ++ } ++ ++ public int getTotalBlocks() { ++ return totalBlocks; ++ } ++ ++ public int getFreeBlocks() { ++ return freeBlocks; ++ } ++ ++ public int getNextAllocation() { ++ return nextAllocation; ++ } ++ ++ public int getRsrcClumpSize() { ++ return rsrcClumpSize; ++ } ++ ++ public int getDataClumpSize() { ++ return dataClumpSize; ++ } ++ ++ public int getWriteCount() { ++ return writeCount; ++ } ++ ++ public long getEncodingsBitmap() { ++ return encodingsBitmap; ++ } ++ ++ public int getNextCatalogID() { ++ return nextCatalogID; ++ } ++ ++ public HFSPlusFinderInfo getFinderInfo() { ++ return finderInfo; ++ } ++ ++ public HFSPlusForkData getAllocationFile() { ++ return allocationFile; ++ } ++ ++ public HFSPlusForkData getExtentsFile() { ++ return extentsFile; ++ } ++ ++ public HFSPlusForkData getCatalogFile() { ++ return catalogFile; ++ } ++ ++ public HFSPlusForkData getAttributesFile() { ++ return attributesFile; ++ } ++ ++ public HFSPlusForkData getStartupFile() { ++ return startupFile; ++ } ++ ++ /** ++ * Convert the dates saved as HFS+ date (32 bit integer representing the number ++ * of seconds since 01.01.1994) to java dates. ++ * @param dis input stream to read from. ++ * @return Date in Java representation (number of milliseconds since 01.01.1970) ++ * @throws IOException something went wrong. ++ */ ++ private Date readMacDate(DataInputStream dis) throws IOException { ++ return new Date(((UNSIGNED_INT_BITS & dis.readInt()) - CONVERT_MAC_TO_JAVA_TIME) * 1000); ++ } ++ ++ @Override ++ public String toString() { ++ return "HFSPlusVolumeHeader{" + ++ "version=" + version + ++ ", attributes=" + attributes + ++ ", lastMountedVersion=" + lastMountedVersion + ++ ", journalInfoBlock=" + journalInfoBlock + ++ ", createDate=" + createDate + ++ ", modifyDate=" + modifyDate + ++ ", backupDate=" + backupDate + ++ ", checkedDate=" + checkedDate + ++ ", fileCount=" + fileCount + ++ ", folderCount=" + folderCount + ++ ", blockSize=" + blockSize + ++ ", totalBlocks=" + totalBlocks + ++ ", freeBlocks=" + freeBlocks + ++ ", nextAllocation=" + nextAllocation + ++ ", rsrcClumpSize=" + rsrcClumpSize + ++ ", nextCatalogID=" + nextCatalogID + ++ ", dataClumpSize=" + dataClumpSize + ++ ", writeCount=" + writeCount + ++ ", encodingsBitmap=" + encodingsBitmap + ++ ", finderInfo=" + finderInfo + ++ ", allocationFile=" + allocationFile + ++ ", extentsFile=" + extentsFile + ++ ", catalogFile=" + catalogFile + ++ ", attributesFile=" + attributesFile + ++ ", startupFile=" + startupFile + ++ '}'; ++ } ++} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d0cef423/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsx/HFSXVolumeHeader.java ---------------------------------------------------------------------- diff --cc flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsx/HFSXVolumeHeader.java index 0000000,0000000..e395c7a new file mode 100644 --- /dev/null +++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/utils/utils/hfsx/HFSXVolumeHeader.java @@@ -1,0 -1,0 +1,29 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.flex.utilities.converter.retrievers.download.utils.utils; ++ ++import java.io.DataInputStream; ++ ++/** ++ * Created by christoferdutz on 27.02.16. ++ */ ++public class HFSXVolumeHeader implements IHFSVolumeHeader { ++ ++ public HFSXVolumeHeader(DataInputStream dis) { ++ } ++ ++}