Examples of DiskObject


Examples of com.kolich.havalo.entities.types.DiskObject

          throw new IOException("Could not create required parent " +
            "directories for object (file=" + f.getAbsolutePath() +
              ")", e);
        }
      }
      return new DiskObject(index, f, new File(parent, fileName));
    } catch (Exception e) {
      throw new ObjectLoadException("Failed to build canonical disk " +
        "object for index/key: " + index, e);
    }
  }
View Full Code Here

Examples of com.kolich.havalo.entities.types.DiskObject

                    // Fail if not found.
                    true);
                new ReentrantReadWriteEntityLock<HashedFileObject>(hfo) {
                    @Override
                    public HashedFileObject transaction() throws Exception {
                        final DiskObject object = getCanonicalObject(repo, hfo);
                        streamHeaders(object, hfo, response);
                        return hfo;
                    }
                }.read(); // Shared read lock on file object
                return null;
View Full Code Here

Examples of com.kolich.havalo.entities.types.DiskObject

                    // Fail if not found.
                    true);
                new ReentrantReadWriteEntityLock<HashedFileObject>(hfo) {
                    @Override
                    public HashedFileObject transaction() throws Exception {
                        final DiskObject object = getCanonicalObject(repo, hfo);
                        // Validate that the object file exists on disk
                        // before we attempt to load it.
                        if(!object.getFile().exists()) {
                            throw new ObjectNotFoundException("Failed " +
                                "to find canonical object on disk " +
                                "(key=" + key + ", file=" +
                                object.getFile().getAbsolutePath() +
                                ")");
                        }
                        streamHeaders(object, hfo, response);
                        streamObject(object, response);
                        return hfo;
View Full Code Here

Examples of com.kolich.havalo.entities.types.DiskObject

                                    "does not match (hfo=" + hfo.getName() +
                                    ", etag=" + eTag + ", if-match=" +
                                    ifMatch + ")");
                            }
                        }
                        final DiskObject object = getCanonicalObject(
                            repo, hfo,
                            // Create the File on disk if it does not
                            // already exist. Yay!
                            true);
                        // The file itself (should exist now).
                        final File objFile = object.getFile();
                        final File tempObjFile = object.getTempFile();
                        try(final InputStream is = request.getInputStream();
                            final OutputStream os = new FileOutputStream(tempObjFile);) {
                            // Compute the ETag (an MD5 hash of the file) while
                            // copying the file into place.  The bytes of the
                            // input stream and piped into an MD5 digest _and_
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.