diff --git a/src/main/java/com/hashbangbash/trie/App.java b/src/main/java/com/hashbangbash/trie/App.java index 9822970..652d19e 100644 --- a/src/main/java/com/hashbangbash/trie/App.java +++ b/src/main/java/com/hashbangbash/trie/App.java @@ -27,6 +27,12 @@ import org.bouncycastle.asn1.*; import org.bouncycastle.x509.extension.X509ExtensionUtil; +/* + * App + * + * This is just a simple class to handle command line interactions + * + */ public class App { public static byte[] getBytesFromFile(File file) throws IOException { @@ -65,11 +71,11 @@ public class App { } - public static List hydrateFromBytes(byte[] derblob) { + public static List hydrateFromBytes(byte[] compressedBlob) { Util util = new Util(); try { - return util.hydrateContentPackage(derblob); + return util.hydrateContentPackage(compressedBlob); } catch (IOException ex) { System.out.println(ex); } diff --git a/src/main/java/com/redhat/trie/PathTree.java b/src/main/java/com/redhat/trie/PathTree.java index eeb29cc..3c1a9f0 100644 --- a/src/main/java/com/redhat/trie/PathTree.java +++ b/src/main/java/com/redhat/trie/PathTree.java @@ -15,11 +15,31 @@ package com.redhat.trie; +import java.util.List; + +/* + * PathTree + * + * The efficient means by which to check the content sets + * + * TODO - this is a prototype stub + */ public class PathTree { private HuffNode dict; private PathNode tree; public PathTree() { } + + public PathTree(byte[] payload) { + } + + public boolean validate(String contentPath) { + return false; + } + + public List toList() { + return null; + } } diff --git a/src/main/java/com/redhat/trie/Util.java b/src/main/java/com/redhat/trie/Util.java index d50ba64..e3e5675 100644 --- a/src/main/java/com/redhat/trie/Util.java +++ b/src/main/java/com/redhat/trie/Util.java @@ -43,6 +43,8 @@ import org.bouncycastle.x509.extension.X509ExtensionUtil; /* * Util * + * All the misc dirty work + * */ public class Util { private NodeContext pathNodeContext; @@ -506,8 +508,23 @@ public class Util { /* * FIXME - break this apart, so that the hydrated payload * can be structure to more quickly search, and use less memory + * + * Rename it for tracking, and to be clear about what is happening */ - public List hydrateContentPackage(byte[] payload) + public List hydrateContentPackage(byte[] compressedBlob) + throws IOException, UnsupportedEncodingException { + try { + return listFromCompressedBlob(compressedBlob); + } catch (Throwable t) { + throw t; + } + } + + /* + * From the deflated payload, produce the content set lists + * + */ + public List listFromCompressedBlob(byte[] payload) throws IOException, UnsupportedEncodingException { List pathDictionary = new ArrayList(); List nodeDictionary = new ArrayList();