コード例 #1
0
  public ResourceFile getFile(String name) {
    FileResource res = this.service.getResource(new FileResourceName(this.name, name));
    if ((res != null) && !res.isFolder()) {
      return new ResourceFileImpl(this.service, res.getName());
    }

    return null;
  }
コード例 #2
0
  public ResourceFolder createFolder(String name) {
    this.service.createFolder(new FileResourceName(this.name, name));
    FileResource res = this.service.getResource(new FileResourceName(this.name, name));

    if ((res != null) && res.isFolder()) {
      return new ResourceFolderImpl(this.service, res.getName());
    }

    return null;
  }
コード例 #3
0
  public List<ResourceFile> getFiles() {
    List<ResourceFile> files = new ArrayList<ResourceFile>();
    for (FileResourceName child : this.service.getChildren(this.name)) {
      FileResource res = this.service.getResource(child);
      if (res != null && !res.isFolder()) {
        files.add(new ResourceFileImpl(this.service, res.getName()));
      }
    }

    return files;
  }