Package org.pentaho.platform.repository2.unified.jcr

Examples of org.pentaho.platform.repository2.unified.jcr.DefaultDeleteHelper


    if (fileInfo == null)
    {
      throw new FileSystemException(FILE_NOT_FOUND, file);
    }

    final RepositoryFileDto fileDto = fileInfo.getFile();
    if (fileDto == null)
    {
      throw new IllegalStateException(BI_SERVER_NULL_OBJECT);
    }
    final String path = normalizePath(fileDto.getPath());
    String urlPath = path;
    try{urlPath = URLEncoder.encodeUTF8(path).replaceAll("\\!", "%21").replaceAll("\\+", "%2B");}catch(Exception ex){}//tcb
    final String service = MessageFormat.format(DOWNLOAD_SERVICE, urlPath);

    return client.resource(url + service).accept(MediaType.APPLICATION_XML_TYPE).get(byte[].class);
View Full Code Here


      if (repositoryFileTreeDto == null)
      {
        continue;
      }

      final RepositoryFileDto file = repositoryFileTreeDto.getFile();
      if (file == null)
      {
        throw new FileSystemException(BI_SERVER_NULL_OBJECT);
      }
      childrenArray[i] = file.getName().replaceAll("\\%", "%25").replaceAll("\\!", "%21").replaceAll("\\+", "%2B");
    }
    return childrenArray;
  }
View Full Code Here

    final RepositoryFileTreeDto fileInfo = lookupNode(fileName);
    if (fileInfo == null)
    {
      throw new FileSystemException(FILE_NOT_FOUND, file);
    }
    final RepositoryFileDto fileDto = fileInfo.getFile();
    if (fileDto == null)
    {
      throw new FileSystemException(BI_SERVER_NULL_OBJECT);
    }
    return fileDto.getTitle();
  }
View Full Code Here

    final RepositoryFileTreeDto fileInfo = lookupNode(pathArray);
    if (fileInfo == null)
    {
      throw new FileSystemException(FILE_NOT_FOUND, name);
    }
    final RepositoryFileDto file = fileInfo.getFile();
    if (file == null)
    {
      throw new FileSystemException(BI_SERVER_NULL_OBJECT);
    }
    return file.getFileSize();
  }
View Full Code Here

  @Override
  public boolean delete( FileName name ) throws FileSystemException {

    boolean success = false;
       
    final RepositoryFileDto file = getFile( name );
   
    try {  
     
      final WebResource resource = client.resource( url + DELETE_FILE_OR_FOLDER );
        final ClientResponse response = resource.put( ClientResponse.class, file.getId() );
        
        if ( response != null && response.getStatus() == Response.Status.OK.getStatusCode() ) {
          refresh();
            success = true;
        } else {
View Full Code Here

   
    if (fileInfo == null) {
      throw new FileSystemException(FILE_NOT_FOUND, name);
    }
   
    final RepositoryFileDto file = fileInfo.getFile();
   
    if ( file == null ) {
      throw new FileSystemException(BI_SERVER_NULL_OBJECT);
    }   
    return file;
View Full Code Here

    final RepositoryFileTreeDto fileInfo = lookupNode(fileName);
    if (fileInfo == null)
    {
      throw new FileSystemException(FILE_NOT_FOUND, file);
    }
    final RepositoryFileDto fileDto = fileInfo.getFile();
    if (fileDto == null)
    {
      throw new FileSystemException(BI_SERVER_NULL_OBJECT);
    }
    return fileDto.isFolder();
  }
View Full Code Here

    final String[] childrenArray = new String[ children.size() ];
    for ( int i = 0; i < children.size(); i++ ) {
      final RepositoryFileTreeDto treeNode = children.get( i );
      if ( treeNode != null ) {
        final RepositoryFileDto file = treeNode.getFile();
        if ( file != null ) {
          logger.debug( "file " + file.getName() );
          childrenArray[ i ] = file.getName();
        } else {
          throw new FileSystemException( NULL_OBJECT );
        }
      }
    }
View Full Code Here

  }

  public static RepositoryFileTreeDto convertFromRepositoryFileTree( RepositoryFileTree tree ) {
    RepositoryFileTreeDto fileTreeDto = new RepositoryFileTreeDto();
    List<RepositoryFileTreeDto> fileList = new ArrayList<RepositoryFileTreeDto>();
    RepositoryFileDto file = convertFromRepositoryFile( tree.getFile() );
    fileTreeDto.setFile( file );
    for ( RepositoryFileTree treeItem : tree.getChildren() ) {
      fileList.add( convertFromRepositoryFileTree( treeItem ) );
    }
    fileTreeDto.setChildren( fileList );
View Full Code Here

    fileTreeDto.setChildren( fileList );
    return fileTreeDto;
  }

  public static RepositoryFileDto convertFromRepositoryFile( RepositoryFile file ) {
    RepositoryFileDto repositoryFile = new RepositoryFileDto();
    repositoryFile.setCreatedDate( file.getCreatedDate() );
    repositoryFile.setDeletedDate( file.getDeletedDate() );
    repositoryFile.setDescription( file.getDescription() );
    repositoryFile.setFolder( file.isFolder() );
    repositoryFile.setHidden( file.isHidden() );
    repositoryFile.setId( file.getId() );
    repositoryFile.setLastModifiedDate( file.getLastModifiedDate() );
    repositoryFile.setLocale( file.getLocale() );
    repositoryFile.setLockDate( file.getLockDate() );
    repositoryFile.setLocked( file.isLocked() );
    repositoryFile.setLockMessage( file.getLockMessage() );
    repositoryFile.setLockOwner( file.getLockOwner() );
    repositoryFile.setName( file.getName() );
    repositoryFile.setOriginalParentFolderPath( file.getOriginalParentFolderPath() );
    repositoryFile.setOriginalParentFolderPath( file.getOriginalParentFolderPath() );
    repositoryFile.setOwner( file.getOwner() );
    repositoryFile.setPath( file.getPath() );
    repositoryFile.setTitle( file.getTitle() );
    repositoryFile.setVersionId( file.getVersionId() );
    return repositoryFile;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.repository2.unified.jcr.DefaultDeleteHelper

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.