@Test public void shouldNotNeedToHashShortNames() { String newName = TandemFilename.join("file1", ".gz"); assertEquals("file1.gz", newName); }
public static String join(String filename, String asciiExtension) { File file = new File(filename); if (file.getParent() != null) { throw new IllegalArgumentException("filename can't have parent"); } if (filename.length() * 4 + asciiExtension.length() <= MAX_CAT_BYTES) { return filename + asciiExtension; } return maybePackSha(filename, asciiExtension); }
TandemFilename { public static String join(String filename, String asciiExtension) { File file = new File(filename); if (file.getParent() != null) { throw new IllegalArgumentException("filename can't have parent"); } if (filename.length() * 4 + asciiExtension.length() <= MAX_CAT_BYTES) { return filename + asciiExtension; } return maybePackSha(filename, asciiExtension); } }
TandemFilename { public static String join(String filename, String asciiExtension) { File file = new File(filename); if (file.getParent() != null) { throw new IllegalArgumentException("filename can't have parent"); } if (filename.length() * 4 + asciiExtension.length() <= MAX_CAT_BYTES) { return filename + asciiExtension; } return maybePackSha(filename, asciiExtension); } private  TandemFilename(); }
TandemFilename { public static String join(String filename, String asciiExtension) { File file = new File(filename); if (file.getParent() != null) { throw new IllegalArgumentException("filename can't have parent"); } if (filename.length() * 4 + asciiExtension.length() <= MAX_CAT_BYTES) { return filename + asciiExtension; } return maybePackSha(filename, asciiExtension); } private  TandemFilename(); static String join(String filename, String asciiExtension); }
TandemFilename { public static String join(String filename, String asciiExtension) { File file = new File(filename); if (file.getParent() != null) { throw new IllegalArgumentException("filename can't have parent"); } if (filename.length() * 4 + asciiExtension.length() <= MAX_CAT_BYTES) { return filename + asciiExtension; } return maybePackSha(filename, asciiExtension); } private  TandemFilename(); static String join(String filename, String asciiExtension);  }