Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileSystemException


            final int status = fileObject.resource.getStatusCode();

            if (status != HttpURLConnection.HTTP_PARTIAL)
            {
                data.close();
                throw new FileSystemException(
                    "vfs.provider.http/get-range.error", new Object[]{
                    fileObject.getName(), new Long(filePointer)});
            }

            mis = data;
View Full Code Here


        auth.scheme = UriParser.extractScheme(uri, name);

        // Expecting "//"
        if (name.length() < 2 || name.charAt(0) != '/' || name.charAt(1) != '/')
        {
            throw new FileSystemException("vfs.provider/missing-double-slashes.error", uri);
        }
        name.delete(0, 2);

        // Extract userinfo, and split into username and password
        final String userInfo = extractUserInfo(name);
        final String userName;
        final String password;
        if (userInfo != null)
        {
            int idx = userInfo.indexOf(':');
            if (idx == -1)
            {
                userName = userInfo;
                password = "";
            }
            else
            {
                userName = userInfo.substring(0, idx);
                password = userInfo.substring(idx + 1);
            }
        }
        else
        {
            userName = "";
            password = "";
        }
        auth.userName = UriParser.decode(userName);
        auth.password = UriParser.decode(password);

        // Extract hostname, and normalise (lowercase)
        final String hostName = extractHostName(name);
        if (hostName == null)
        {
            throw new FileSystemException("vfs.provider/missing-hostname.error", uri);
        }
        auth.hostName = hostName; //.toLowerCase();

        // Extract port
        auth.port = extractPort(name, uri);

        // Expecting '/' or empty name
        if (name.length() > 0 && name.charAt(0) != '/')
        {
            throw new FileSystemException("vfs.provider/missing-hostname-path-sep.error", uri);
        }

        return auth;
    }
View Full Code Here

        final String port = name.substring(1, pos);
        name.delete(0, pos);
        if (port.length() == 0)
        {
            throw new FileSystemException("vfs.provider/missing-port.error", uri);
        }

        return Integer.parseInt(port);
    }
View Full Code Here

     */
    public FileObject createFileSystem(final String scheme, final FileObject file, final FileSystemOptions properties)
        throws FileSystemException
    {
        // Can't create a layered file system
        throw new FileSystemException("vfs.provider/not-layered-fs.error", scheme);
    }
View Full Code Here

        if (getFileNameParser() != null)
        {
            return getFileNameParser().parseUri(getContext(), base, uri);
        }

        throw new FileSystemException("vfs.provider/filename-parser-missing.error");
        // return GenericFileName.parseUri(getFileNameParser(), uri, 0);
    }
View Full Code Here

        {
            return new JarFile(file);
        }
        catch (IOException ioe)
        {
            throw new FileSystemException("vfs.provider.jar/open-jar-file.error", file, ioe);
        }
    }
View Full Code Here

            final String value = attr.getValue(attrName);
            return value;
        }
        catch (IOException ioe)
        {
            throw new FileSystemException(attrName.toString(), ioe);
        }
    }
View Full Code Here

          return FileType.FILE;
        }
      } catch(Exception ex) {
        return FileType.FOLDER;
      }
        throw new FileSystemException("vfs.provider.smb/get-type.error", getName());
    }
View Full Code Here

    }


    public JarFile getJarFile() throws IOException
    {
        throw new FileSystemException("vfs.provider.jar/jar-file-no-access.error");
    }
View Full Code Here

    }


    public JarEntry getJarEntry() throws IOException
    {
        throw new FileSystemException("vfs.provider.jar/jar-entry-no-access.error");
    }
View Full Code Here

TOP

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

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.