class ZipUtils {

  public static Optional<ArrayByteSource> unzipPathNameInMemory(BeanByteSource source, String relativePathName) {
    ArgChecker.notNull(relativePathName, "relativePathName");
    try (ZipInputStream in = new ZipInputStream(source.openStream())) {
      ZipEntry entry = in.getNextEntry();
      while (entry != null) {
        validateZipPathName(DUMMY_PATH, entry);
        if (!entry.isDirectory() && entry.getName().equals(relativePathName)) {
          ArrayByteSource extractedBytes = extractInputStream(in, entry.getName());
          return Optional.of(extractedBytes);
        }
        in.closeEntry();
        entry = in.getNextEntry();
      }
    } catch (IOException ex) {
      throw new UncheckedIOException(ex);
    }
    return Optional.empty();
  }

  private  ZipUtils();

}