Package org.platformlayer.ops.filesystem

Examples of org.platformlayer.ops.filesystem.FilesystemInfo


  public void handler() throws OpsException, IOException {
    // TODO: Only if not installed
    OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);

    File cgroupsFile = new File("/cgroup");
    FilesystemInfo info = target.getFilesystemInfoFile(cgroupsFile);
    if (info != null) {
      // TODO: Better idempotency
      return;
    }
View Full Code Here


  }

  @Override
  protected boolean alreadyExists() throws OpsException {
    OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);
    FilesystemInfo dirInfo = target.getFilesystemInfoFile(new File(getDataDirectory(), "objectClass.bdb"));

    return dirInfo != null;
  }
View Full Code Here

  public File srcDir;
  public File iso;

  @Handler
  public void handler(OpsTarget target) throws OpsException {
    FilesystemInfo isoInfo = target.getFilesystemInfoFile(iso);

    boolean rebuild = true;
    if (isoInfo != null) {
      // TODO: Do timestamp based dependency checking?
      rebuild = false;
View Full Code Here

    if (buildTar) {
      Command compress = Command.build("cd {0}; tar jcf {1} .", rootfsDir, imageFile);
      target.executeCommand(compress.setTimeout(TimeSpan.FIFTEEN_MINUTES));
    }

    FilesystemInfo imageInfo = target.getFilesystemInfoFile(imageFile);

    File uploadImageFile;

    if (!buildTar) {
      boolean isQcow2 = imageFormat == ImageFormat.DiskQcow2;
View Full Code Here

      String[] fieldValues = line.split("\t");
      if (fieldValues.length != fields.length) {
        throw new OpsException("Cannot parse line: " + line);
      }

      FilesystemInfo filesystemInfo = new FilesystemInfo();

      for (int i = 0; i < fieldValues.length; i++) {
        String field = fields[i];
        String fieldValue = fieldValues[i];
        if (field.equals("u")) {
View Full Code Here

  }

  private File checkDirectory(File base, Md5Hash hash, int splits) throws OpsException {
    String relativePath = toRelativePath(hash, splits);
    File seedFile = new File(base, relativePath);
    FilesystemInfo seedFileInfo = host.getFilesystemInfoFile(seedFile);
    if (seedFileInfo != null) {
      Md5Hash seedFileHash = host.getFileHash(seedFile);
      if (!seedFileHash.equals(hash)) {
        log.warn("Hash mismatch on file: " + seedFile);
        return null;
View Full Code Here

  }

  @Override
  public void release(PlatformLayerKey owner, T item) throws OpsException {
    File symlink = new File(assignedDir, toKey(item));
    FilesystemInfo info = target.getFilesystemInfoFile(symlink);
    if (info == null) {
      throw new OpsException("Symlink not found");
    }

    if (!Objects.equal(info.symlinkTarget, toFile(owner).getAbsolutePath())) {
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.filesystem.FilesystemInfo

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.