Package org.pentaho.platform.repository2.unified.webservices

Examples of org.pentaho.platform.repository2.unified.webservices.StringKeyStringValueDto


  }

  public byte[] getData(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 IllegalStateException(BI_SERVER_NULL_OBJECT);
    }
    final String path = normalizePath(fileDto.getPath());
View Full Code Here


  {
    final List<RepositoryFileTreeDto> children = getChildren(name);
    final String[] childrenArray = new String[children.size()];
    for (int i = 0; i < children.size(); i++)
    {
      final RepositoryFileTreeDto repositoryFileTreeDto = children.get(i);
      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");
View Full Code Here

  }

  public String getLocalizedName(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.getTitle();
View Full Code Here

  }

  public long getContentSize(final FileName name) throws FileSystemException
  {
    final String[] pathArray = computeFileNames(name);
    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

  if(name == null){
      throw new FileSystemException(FILE_NOT_FOUND);
    }
       
    final String[] pathArray = computeFileNames( name );
    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;
View Full Code Here

    final int depth = -1;
    final String filter = "*";
    final boolean showHidden = true;

    RepositoryFileTreeDto fileTree = null;
    if ( this.doGetRootChildrenMethod == null ) {
      fileTree = this.fileRes.doGetRootTree( depth, filter, showHidden, false );
    } else {
      // apply [5.0-SNAPSHOT] backport
      try {
View Full Code Here

    }
    return stack;
  }

  private RepositoryFileDto getFile( FileName fullName ) throws FileSystemException {
    final RepositoryFileTreeDto tree = getTreeNode( fullName );
    if ( tree == null ) {
      throw new FileSystemException( FILE_NOT_FOUND, fullName );
    }
    return tree.getFile();
  }
View Full Code Here

    }
    return tree.getFile();
  }

  private List<RepositoryFileTreeDto> getChildNodes( final FileName fullName ) throws FileSystemException {
    final RepositoryFileTreeDto tree = getTreeNode( fullName );
    if ( tree == null ) {
      throw new FileSystemException( FILE_NOT_FOUND, fullName );
    }
    final List<RepositoryFileTreeDto> children = tree.getChildren();
    return children == null ? Collections.<RepositoryFileTreeDto>emptyList() : children;
  }
View Full Code Here

    final List<RepositoryFileTreeDto> children = getChildNodes( fullName );
    logger.debug( "size = " + children.size() );

    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

    config.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, true);
    Client client = Client.create(config);
    client.addFilter(new HTTPBasicAuthFilter("joe", "password"));

    final WebResource resource = client.resource(url + "/api/repo/files/children?depth=-1&filter=*");
    final RepositoryFileTreeDto tree = resource.path("").accept(MediaType.APPLICATION_XML_TYPE).get(RepositoryFileTreeDto.class);

    printDebugInfo(tree);

    final List<RepositoryFileTreeDto> children = tree.getChildren();
    for (int i = 0; i < children.size(); i++)
    {
      final RepositoryFileTreeDto child = children.get(i);
      printDebugInfo(child);
    }

/*
    final FileSystemOptions fileSystemOptions = new FileSystemOptions();
View Full Code Here

TOP

Related Classes of org.pentaho.platform.repository2.unified.webservices.StringKeyStringValueDto

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.