Example #1
0
 /**
  * @param session
  * @return
  */
 public List<Path> copy(Session session) {
   List<Path> content = new ArrayList<Path>();
   for (Path path : this) {
     content.add(PathFactory.createPath(session, path.getAsDictionary()));
   }
   return content;
 }
Example #2
0
 public void testDefaultPathRoot() {
   {
     Host host = new Host("localhost");
     host.setDefaultPath("/");
     Path path =
         PathFactory.createPath(SessionFactory.createSession(host), "/file", Path.DIRECTORY_TYPE);
     assertEquals("http://localhost/file", path.toHttpURL());
     host.setWebURL("http://127.0.0.1/~dkocher");
     assertEquals("http://127.0.0.1/~dkocher/file", path.toHttpURL());
   }
 }
    @Override
    protected void onBoundsChange(Rect bounds) {
      super.onBoundsChange(bounds);

      if (isCanvasRectEmpty()) {
        path = Optional.absent();
        backgroundPaint.setShader(null);
        return;
      }

      path = Optional.of(pathFactory.newInstance(bounds));
      backgroundPaint.setShader(
          new LinearGradient(
              0, bounds.top, 0, bounds.bottom - 1, topColor, bottomColor, TileMode.CLAMP));
    }
Example #4
0
  public void addToNode(Node parentNode, PathFactory pathFactory) {
    Map<String, Object> libraryAttributes = Maps.newHashMapWithExpectedSize(2);
    libraryAttributes.put("name", name);
    if (type != null) {
      libraryAttributes.put("type", type);
    }
    Node libraryNode = parentNode.appendNode("library", libraryAttributes);
    Node classesNode = libraryNode.appendNode("CLASSES");
    for (File file : classes) {
      Map<String, Object> attributes = Maps.newHashMapWithExpectedSize(1);
      attributes.put("url", pathFactory.path(file).getUrl());
      classesNode.appendNode("root", attributes);
    }
    Node javadocNode = libraryNode.appendNode("JAVADOC");
    for (File file : javadoc) {
      Map<String, Object> attributes = Maps.newHashMapWithExpectedSize(1);
      attributes.put("url", pathFactory.path(file).getUrl());
      javadocNode.appendNode("root", attributes);
    }
    Node sourcesNode = libraryNode.appendNode("SOURCES");
    for (File file : sources) {
      Map<String, Object> attributes = Maps.newHashMapWithExpectedSize(1);
      attributes.put("url", pathFactory.path(file).getUrl());
      sourcesNode.appendNode("root", attributes);
    }

    if (compilerClasspath.size() > 0) {
      Node properties = libraryNode.appendNode("properties");
      Node compilerClasspathNode = properties.appendNode("compiler-classpath");
      for (File file : compilerClasspath) {
        Map<String, Object> attributes = Maps.newHashMapWithExpectedSize(1);
        attributes.put("url", pathFactory.path(file, true).getUrl());
        compilerClasspathNode.appendNode("root", attributes);
      }
    }
  }
Example #5
0
 public static String configJobHost(final JobId jobId, final String host) {
   return CONFIG_JOBS.path(jobId.toString(), HOSTS, host);
 }
Example #6
0
 public static String configJobRefShort(final JobId id) {
   return CONFIG_JOBREFS.path(id.getName() + ":" + id.getVersion());
 }
Example #7
0
 public static String configJob(final JobId id) {
   return CONFIG_JOBS.path(id.toString());
 }
Example #8
0
 public static String configJobs() {
   return CONFIG_JOBS.path();
 }
Example #9
0
 public static String historyJobs() {
   return HISTORY_JOBS.path();
 }
Example #10
0
 public static String historyJobHost(final JobId jobId, final String host) {
   return HISTORY_JOBS.path(jobId.toString(), HOSTS, host);
 }
Example #11
0
 public static String statusHosts() {
   return STATUS_HOSTS.path();
 }
Example #12
0
 public static String configId(final String id) {
   return CONFIG_ID.path(id);
 }
Example #13
0
 public static String configHostPort(final String host, final int port) {
   return CONFIG_HOSTS.path(host, PORTS, String.valueOf(port));
 }
Example #14
0
 public static String configHostPorts(final String host) {
   return CONFIG_HOSTS.path(host, PORTS);
 }
Example #15
0
 public static String configHostJobCreation(
     final String host, final JobId id, final UUID operationId) {
   return CONFIG_HOSTS.path(host, JOBS, id.toString(), CREATION_PREFIX + operationId);
 }
Example #16
0
 public static String historyJobHostEventsTimestamp(
     final JobId jobId, final String host, final long timestamp) {
   return HISTORY_JOBS.path(jobId.toString(), HOSTS, host, EVENTS, String.valueOf(timestamp));
 }
Example #17
0
 public static String historyJobHosts(final JobId jobId) {
   return HISTORY_JOBS.path(jobId.toString(), HOSTS);
 }
Example #18
0
 public static String statusHostJobs(final String host) {
   return STATUS_HOSTS.path(host, JOBS);
 }
Example #19
0
 public static String historyJob(final JobId jobId) {
   return HISTORY_JOBS.path(jobId.toString());
 }
Example #20
0
 public static String statusHostJob(final String host, final JobId jobId) {
   return STATUS_HOSTS.path(host, JOBS, jobId.toString());
 }
Example #21
0
 public static String configHosts() {
   return CONFIG_HOSTS.path();
 }
Example #22
0
 public static String statusHostUp(final String host) {
   return STATUS_HOSTS.path(host, UP);
 }
Example #23
0
 public static String configJobRefs() {
   return CONFIG_JOBREFS.path();
 }
Example #24
0
 public static String statusMasterUp(final String master) {
   return STATUS_MASTERS.path(master, UP);
 }
Example #25
0
 public static String configJobCreation(final JobId id, final UUID operationId) {
   final String name = CREATION_PREFIX + operationId;
   return CONFIG_JOBS.path(id.toString(), name);
 }
Example #26
0
 public static String statusMaster() {
   return STATUS_MASTERS.path();
 }
Example #27
0
 public static String configJobHosts(final JobId jobId) {
   return CONFIG_JOBS.path(jobId.toString(), HOSTS);
 }
Example #28
0
 public static String statusHostAgentInfo(final String host) {
   return STATUS_HOSTS.path(host, AGENTINFO);
 }
Example #29
0
 public static String configHost(final String host) {
   return CONFIG_HOSTS.path(host);
 }
Example #30
0
 public static String statusHostEnvVars(final String host) {
   return STATUS_HOSTS.path(host, ENVIRONMENT);
 }