Package adept.artifact.models

Examples of adept.artifact.models.ArtifactHash


    ArtifactDownloadResult result = null;
    while (result == null) {
      FileOutputStream fos = null;
      InputStream is = null;
      try {
        ArtifactHash hash = artifact.hash;
        File currentCachedFile = ArtifactCache.getOrCreateExistingCacheFile(baseDir, hash, filename, verify);
        if (currentCachedFile != null && currentCachedFile.isFile()) {
          result = new ArtifactDownloadResult(artifact, tmpFile, filename);
          result.setCachedFile(currentCachedFile);
        } else {
View Full Code Here


    }
    return new ArtifactAttribute(name, values);
  }

  private static LockfileArtifact parseArtifact(JsonParser parser) throws IOException {
    ArtifactHash hash = null;
    Integer size = null;
    Set<ArtifactLocation> locations = null;
    Set<ArtifactAttribute> attributes = null;
    String filename = null;
    assert (parser.getCurrentToken() == JsonToken.START_OBJECT);
    while (parser.nextToken() != JsonToken.END_OBJECT) {
      assert (parser.getCurrentToken() == JsonToken.FIELD_NAME);
      String fieldName = parser.getCurrentName();
      // Get value or array start token
      parser.nextToken();
      if (fieldName.equals("hash")) {
        hash = new ArtifactHash(parser.getValueAsString());
      } else if (fieldName.equals("size")) {
        size = parser.getValueAsInt();
      } else if (fieldName.equals("locations")) {
        locations = new HashSet<ArtifactLocation>();
        assert (parser.getCurrentToken() == JsonToken.START_ARRAY);
View Full Code Here

TOP

Related Classes of adept.artifact.models.ArtifactHash

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.