Example usage for org.apache.commons.vfs2 FileSystemException FileSystemException

List of usage examples for org.apache.commons.vfs2 FileSystemException FileSystemException

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileSystemException FileSystemException.

Prototype

public FileSystemException(final Throwable throwable) 

Source Link

Document

Constructs wrapper exception.

Usage

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public String getLocalizedName(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }/*from w w  w. j av  a2 s .  co m*/
    return fileInfo.getLocalizedName();
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public void setDescription(final FileName file, final String description) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }//from  www  . ja v a 2 s.c  o m
    fileInfo.setDescription(description);
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public String getDescription(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }//from  w  ww .  ja  v  a  2  s .c  o m
    return fileInfo.getDescription();
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public long getLastModifiedDate(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }/*from  w w w. ja  v  a2  s .  com*/
    return fileInfo.getLastModifiedDate();
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public String getParamServiceUrl(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }/* w w  w  .  ja v  a 2s.  co  m*/
    return fileInfo.getParameterServiceURL();
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public String getTitle(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }//from w  w w . j  a va 2 s. c om
    return fileInfo.getTitle();
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public String[] getChilds(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }/*from w w  w . j ava 2  s.  c om*/
    final FileInfo[] childs = fileInfo.getChilds();
    final String[] childNames = new String[childs.length];
    for (int i = 0; i < childs.length; i++) {
        final FileInfo child = childs[i];
        childNames[i] = child.getName();
    }
    return childNames;
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public String getUrl(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }//from  www  .j a  va 2 s.  c om
    return fileInfo.getUrl();
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

protected FileInfo lookupNode(final String[] path) throws FileSystemException {
    if (root == null) {
        try {//from   ww  w .  ja va2  s  .  c o  m
            refresh();
        } catch (IOException e) {
            throw new FileSystemException(e);
        }
    }
    if (path.length == 0) {
        return root;
    }
    if ("".equals(path[0])) {
        if (path.length == 1) {
            return root;
        }
    } else {
        return null;
    }

    FileInfo element = root;
    for (int i = 1; i < path.length; i++) {
        final FileInfo name = element.getChild(path[i]);
        if (name == null) {
            return null;
        }
        element = name;
    }
    return element;
}

From source file:org.pentaho.reporting.libraries.pensol.vfs.XmlSolutionFileModel.java

public byte[] getData(final FileName file) throws FileSystemException {
    final String[] fileName = computeFileNames(file);
    final FileInfo fileInfo = lookupNode(fileName);
    if (fileInfo == null) {
        throw new FileSystemException("File is not valid.");
    }/*w w w .  j  ava 2  s.com*/

    return getDataInternally(fileInfo);
}