Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileType


        final StringBuffer buffer = new StringBuffer(uri);
        final String scheme = UriParser.extractScheme(uri, buffer);

        UriParser.fixSeparators(buffer);
       
        FileType fileType = UriParser.normalisePath(buffer);
        final String path = buffer.toString();

        // Create the temp file system if it does not exist
        // FileSystem filesystem = findFileSystem( this, (Properties) null);
        FileSystem filesystem = findFileSystem(this, properties);
View Full Code Here


    /**
     * Adds a child to this file.
     */
    public void attachChild(final FileName baseName, final FileType type) throws Exception
    {
        final FileType oldType = doGetType();
        if (children.add(baseName.getBaseName()))
        {
            childrenChanged(baseName, type);
        }
        maybeTypeChanged(oldType);
View Full Code Here

    /**
     * Attaches or detaches the target file.
     */
    public void setFile(final FileObject file) throws Exception
    {
        final FileType oldType = doGetType();

        if (file != null)
        {
            file.getFileSystem().addListener(file, this);
        }
View Full Code Here

     * Checks whether the file's type has changed, and fires the appropriate
     * events.
     */
    private void maybeTypeChanged(final FileType oldType) throws Exception
    {
        final FileType newType = doGetType();
        if (oldType == FileType.IMAGINARY && newType != FileType.IMAGINARY)
        {
            handleCreate(newType);
        }
        else if (oldType != FileType.IMAGINARY && newType == FileType.IMAGINARY)
View Full Code Here

       
        // Extract the root prefix
        final String rootFile = extractRootPrefix(filename, name);

        // Normalise the path
        FileType fileType = UriParser.normalisePath(name);

        final String path = name.toString();

        return createFileName(
            scheme,
View Full Code Here

    }
    catch (IOException e)
    {
      return false;
    }
    final FileType type = vfsConnection.getType();
    if (type != FileType.FOLDER)
    {
      return false;
    }
    return true;
View Full Code Here

        return getExtendedPrimaryNodeType();
    }

    public ExtendedNodeType getExtendedPrimaryNodeType() throws RepositoryException {
        try {
            FileType fileType = fileObject.getType();
            if (fileType == FileType.FILE) {
                return NodeTypeRegistry.getInstance().getNodeType(Constants.JAHIANT_FILE);
            } else if (fileType == FileType.FOLDER) {
                return NodeTypeRegistry.getInstance().getNodeType(Constants.JAHIANT_FOLDER);
            }
View Full Code Here

    }
    catch (IOException e)
    {
      return false;
    }
    final FileType type = vfsConnection.getType();
    if (type != FileType.FOLDER)
    {
      return false;
    }
    return true;
View Full Code Here

    return fileRef;
  }

  public FileName getName() {
    initFile();
    FileType fileType = null;
    try {
      fileType = getType();
    } catch ( Exception ex ) {
      fileType = FileType.FOLDER;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.FileType

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.