Package de.innovationgate.wgaservices.types

Examples of de.innovationgate.wgaservices.types.FSDesignResourceState


   * @param path path rooted at the wga design root
   * @param local true if this is a local path / false if path is remote
   * @return
   */
  private boolean isAffected(IPath path, boolean local) {
    FSDesignResourceState stateA = null;
    FSDesignResourceState stateB = null;
    if (local) {
      stateA = _localStates.get(path);
      stateB = _remoteStates.get(path);
    } else {           
      stateA = _remoteStates.get(path);
      stateB = _localStates.get(path);
    }
    if (stateA == null) {
      return false;
    }
    if (stateA.getType() == FSDesignResourceState.TYPE_FILE) {
      return (stateB == null || stateB.getLastmodified() != stateA.getLastmodified());     
    } else if (stateA.getType() == FSDesignResourceState.TYPE_FOLDER) {
      if (stateB == null) {
        // this is a folder deletion
        return true;
      } else {
View Full Code Here


                SyncInfo info = new WGAPluginResourceSyncInfo(_runtime, _server, resource, localPluginInfo, variant, _remoteWGAVersion);
                info.init();
                return info;
            } else {
              IResourceVariant variant = null;
              FSDesignResourceState state = _remoteStatesByResource.get(resource);
              if (state != null) {
                variant = new WGAFSDesignResourceVariant(_server, state);
              }
              LocalFSDesignResourceState localState = _localStatesByResource.get(resource);
              SyncInfo info = new WGAFSDesignResourceSyncInfo(_runtime, _server, resource, localState, variant, variant, _comparator);
View Full Code Here

        String linkName = _localState.getDirLinkName();
        IContainer linkTarget = _localState.getDirLinkTarget();
        int matchingSegments = linkTarget.getFullPath().matchingFirstSegments(getLocal().getFullPath());     
        return new Path(linkName).append(getLocal().getFullPath().removeFirstSegments(matchingSegments)).makeRelative().toString();       
      } else if (getRemote() != null) {
        FSDesignResourceState remoteState = ((WGAFSDesignResourceVariant)getRemote()).getState();
        if (remoteState != null) {
          return remoteState.getPath();
        }
      }
    }
    return null;
  }
View Full Code Here

    return new ArrayList<FSDesignResourceState>();
  }

  private List<FSDesignResourceState> createStates(FileObject base, FileObject file) throws NoSuchAlgorithmException, IOException {
    List<FSDesignResourceState> states = new ArrayList<FSDesignResourceState>();
    FSDesignResourceState state = new FSDesignResourceState();
    String path = computeRelativePath(base, file);
    state.setPath(path);
    states.add(state);
    if (file.getType() ==  FileType.FOLDER) {
      state.setType(FSDesignResourceState.TYPE_FOLDER);
      long lastModified = 0;
      for (FileObject child : file.getChildren()) {
        List<FSDesignResourceState> childStates = createStates(base, child);
        for (FSDesignResourceState childState : childStates) {
          states.add(childState);
          lastModified = Math.max(lastModified, childState.getLastmodified());
        }
      }
      state.setLastmodified(lastModified);
    } else {     
      state.setType(FSDesignResourceState.TYPE_FILE);
      state.setLastmodified(file.getContent().getLastModifiedTime());
      state.setMd5sum(WGUtils.createMD5HEX(file.getContent().getInputStream()));
    }
    return states;
  }
View Full Code Here

TOP

Related Classes of de.innovationgate.wgaservices.types.FSDesignResourceState

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.