Package org.pentaho.platform.repository2.unified.fileio

Examples of org.pentaho.platform.repository2.unified.fileio.RepositoryFileOutputHandler


      collator.setStrength( Collator.PRIMARY ); // ignore case
      sortByLocaleTitle( collator, tree );
    }

    for ( RepositoryFileTreeDto child : tree.getChildren() ) {
      RepositoryFileDto file = child.getFile();
      Map<String, Serializable> fileMeta = getRepository().getFileMetadata( file.getId() );
      boolean isSystemFolder =
        fileMeta.containsKey( IUnifiedRepository.SYSTEM_FOLDER ) ? (Boolean) fileMeta
          .get( IUnifiedRepository.SYSTEM_FOLDER ) : false;
      if ( !isSystemFolder ) {
        filteredChildren.add( child );
View Full Code Here


   * @throws FileNotFoundException
   * @private
   */
  private List<RepositoryFileDto> doGetGeneratedContentForUser( String pathId, String userDir )
    throws FileNotFoundException {
    RepositoryFileDto targetFile = doGetProperties( pathId );
    if ( targetFile != null ) {
      String targetFileId = targetFile.getId();
      return searchGeneratedContent( userDir, targetFileId, PentahoJcrConstants.PHO_CONTENTCREATOR );
    } else {
      logger.error( Messages.getInstance().getString( "FileResource.FILE_NOT_FOUND", pathId ) );
      throw new FileNotFoundException( pathId );
    }
View Full Code Here

   * @return            A jax-rs Response object with the appropriate status code, header, and body.
   */
  public boolean doCreateDir( String pathId ) {
    String path = idToPath( pathId );
    String[] folders = path.split( "[" + FileUtils.PATH_SEPARATOR + "]" ); //$NON-NLS-1$//$NON-NLS-2$
    RepositoryFileDto parentDir = getRepoWs().getFile( FileUtils.PATH_SEPARATOR );
    boolean dirCreated = false;
    for ( String folder : folders ) {
      String currentFolderPath = ( parentDir.getPath() + FileUtils.PATH_SEPARATOR + folder ).substring( 1 );
      if ( !currentFolderPath.startsWith( FileUtils.PATH_SEPARATOR ) ) {
        currentFolderPath = FileUtils.PATH_SEPARATOR + currentFolderPath;
      }
      RepositoryFileDto currentFolder = getRepoWs().getFile( currentFolderPath );
      if ( currentFolder == null ) {
        currentFolder = new RepositoryFileDto();
        currentFolder.setFolder( true );
        currentFolder.setName( decode( folder ) );
        currentFolder.setPath( parentDir.getPath() + FileUtils.PATH_SEPARATOR + folder );
        currentFolder = getRepoWs().createFolder( parentDir.getId(), currentFolder, currentFolderPath );
        dirCreated = true;
      }
      parentDir = currentFolder;
    }
View Full Code Here

  public List<RepositoryFileDto> doGetChildren( String pathId, String filter, Boolean showHidden,
                                                Boolean includeAcls ) {

    List<RepositoryFileDto> repositoryFileDtoList = new ArrayList<RepositoryFileDto>();
    RepositoryFileDto repositoryFileDto = getRepoWs().getFile( FileUtils.idToPath( pathId ) );

    if ( repositoryFileDto != null && isPathValid( repositoryFileDto.getPath() ) ) {
      RepositoryRequest repositoryRequest = getRepositoryRequest( repositoryFileDto, showHidden, filter, includeAcls );
      repositoryFileDtoList = getRepoWs().getChildrenFromRequest( repositoryRequest );

      // BISERVER-9599 - Use special sort order
      if ( isShowingTitle( repositoryRequest ) ) {
View Full Code Here

  }

  public void refresh() throws IOException
  {
    final WebResource resource = client.resource(url + LOAD_REPOSITORY_SERVICE);
    final RepositoryFileTreeDto tree = resource.path("").accept(MediaType.APPLICATION_XML_TYPE).get(RepositoryFileTreeDto.class);
    setRoot(tree);
  }
View Full Code Here

  }

  public boolean isDirectory(final FileName file) throws FileSystemException
  {
    final String[] fileName = computeFileNames(file);
    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

  }

  public boolean exists(final FileName file) throws FileSystemException
  {
    final String[] fileName = computeFileNames(file);
    final RepositoryFileTreeDto fileInfo = lookupNode(fileName);
    return (fileInfo != null);
  }
View Full Code Here

  }

  public boolean isVisible(final FileName file) throws FileSystemException
  {
    final String[] fileName = computeFileNames(file);
    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.isHidden();
View Full Code Here

  }

  public void setDescription(final FileName file, final String description) throws FileSystemException
  {
    final String[] fileName = computeFileNames(file);
    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);
    }
    fileDto.setDescription(description);
View Full Code Here

  }

  public String getDescription(final FileName file) throws FileSystemException
  {
    final String[] fileName = computeFileNames(file);
    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.getDescription();
View Full Code Here

TOP

Related Classes of org.pentaho.platform.repository2.unified.fileio.RepositoryFileOutputHandler

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.