public static Resource toResource(
      WebDAVRequest webDAVRequest, String type, String rootPath, boolean appendPath) {

    String parentPath = rootPath + webDAVRequest.getPath();

    String name = StringPool.BLANK;

    if (appendPath) {
      name = type;
    }

    Resource resource = new BaseResourceImpl(parentPath, name, type);

    resource.setModel(type);

    return resource;
  }
Esempio n. 2
0
  protected Resource toResource(WebDAVRequest webDavRequest, IGFolder folder, boolean appendPath) {

    String parentPath = getRootPath() + webDavRequest.getPath();
    String name = StringPool.BLANK;

    if (appendPath) {
      name = folder.getName();
    }

    Resource resource =
        new BaseResourceImpl(
            parentPath, name, folder.getName(), folder.getCreateDate(), folder.getModifiedDate());

    resource.setModel(folder);
    resource.setClassName(IGFolder.class.getName());
    resource.setPrimaryKey(folder.getPrimaryKey());

    return resource;
  }