Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileType


    /**
     * 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))
        {
            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

        String queryString = UriParser.extractQueryString(name);

        // Decode and normalise the file name
        UriParser.canonicalizePath(name, 0, name.length(), this);
        UriParser.fixSeparators(name);
        FileType fileType = UriParser.normalisePath(name);
        final String path = name.toString();

        return new URLFileName(
            auth.scheme,
            auth.hostName,
View Full Code Here

   @see #fixSeparators
   */
  public static FileType normalisePath(final StringBuffer path)
      throws FileSystemException
  {
    FileType fileType = FileType.FOLDER;
    if (path.length() == 0)
    {
      return fileType;
    }

View Full Code Here

     * Returns the size of the content (in bytes).
     */
    public long getSize() throws FileSystemException
    {
        // Do some checking
        FileType fileType = file == null ? null : file.getType();
        if (fileType == null || !fileType.hasContent())
        {
            throw new FileSystemException("vfs.provider/get-size-not-file.error", file);
        }
        /*
        if (getThreadData().getState() == STATE_WRITING || getThreadData().getState() == STATE_RANDOM_ACCESS)
View Full Code Here

        if (getThreadData().getState() == STATE_WRITING || getThreadData().getState() == STATE_RANDOM_ACCESS)
        {
            throw new FileSystemException("vfs.provider/get-last-modified-writing.error", file);
        }
        */
        FileType fileType = file.getType();
        if (fileType == null || !file.getType().hasAttributes())
        {
            throw new FileSystemException("vfs.provider/get-last-modified-no-exist.error", file);
        }
        try
View Full Code Here

        final Authority auth = extractToPath(filename, name);

        // Decode and normalise the file name
        UriParser.canonicalizePath(name, 0, name.length(), this);
        UriParser.fixSeparators(name);
        FileType fileType = UriParser.normalisePath(name);
        final String path = name.toString();

        return new GenericFileName(
            auth.scheme,
            auth.hostName,
View Full Code Here

        }

        // Decode and normalise the path
        UriParser.canonicalizePath(name, 0, name.length(), this);
        UriParser.fixSeparators(name);
        FileType fileType = UriParser.normalisePath(name);
        final String path = name.toString();

        return new LayeredFileName(scheme, rootUri, path, fileType);
    }
View Full Code Here

          //                              actualFilename);
        }

        // Normalise the path.  Do this after extracting the share name,
        // to deal with things like smb://hostname/share/..
        FileType fileType = UriParser.normalisePath(name);
        final String path = name.toString();

        return new SmbFileName(
            auth.scheme,
            auth.hostName,
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.