diff --git a/src/Scotty.java b/src/Scotty.java index 0b7987a..6d67cb1 100644 --- a/src/Scotty.java +++ b/src/Scotty.java @@ -1,7 +1,12 @@ import java.io.File; +import java.io.FileNotFoundException; import java.io.InputStream; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import java.util.Random; +import java.util.zip.Deflater; +import java.io.RandomAccessFile; public class Scotty { public enum CompressionFormats { @@ -19,7 +24,8 @@ public class Scotty { public enum PathModes { RELATIVE(0), - ABSOLUTE(1); + IGNORE_CASE(1), + ABSOLUTE(2); private final int value; PathModes(final int value) {this.value = value;} @@ -53,10 +59,12 @@ public class Scotty { } public class PSARC { + public byte[] version = new byte[]{0, 0, 0, 0}; // fixed length of 32 bits public CompressionFormats algorithm = CompressionFormats.ZLIB; // the algorithm used to compress the files public byte strength = 9; // intensity of the compression algorithm from 0 to 9 public long blockSize = 65536; - private File fromDisk = null; + public PathModes mode = PathModes.RELATIVE; + private RandomAccessFile fromDisk = null; // if NULL then file is a new file private List files = new ArrayList(); public PSARC() { // new w/ defaults @@ -65,6 +73,11 @@ public class Scotty { public PSARC(File location) { // existing // todo: read psarc and set vars above + try {fromDisk = new RandomAccessFile(location, "read");} catch ( + FileNotFoundException e) {throw new RuntimeException(e); + } + System.out.println(); + } public PSARC(CompressionFormats algorithm, byte strength) { // new