Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileSystemException


        {
            getAttributes(); // early get the attributes as the zip file might be closed
        }
        catch (IOException e)
        {
            throw new FileSystemException(e);
        }
    }
View Full Code Here


                }
            };
        }
        catch (MalformedURLException e)
        {
            throw new FileSystemException("vfs.provider/random-access-open-failed.error", smbFile, e);
        }
        catch (SmbException e)
        {
            throw new FileSystemException("vfs.provider/random-access-open-failed.error", smbFile, e);
        }
        catch (UnknownHostException e)
        {
            throw new FileSystemException("vfs.provider/random-access-open-failed.error", smbFile, e);
        }
    }
View Full Code Here

        {
        }
        if (startPos == maxlen && name.length() > startPos && name.charAt(startPos + 1) == '/')
        {
            // Too many '/'
            throw new FileSystemException("vfs.provider.local/not-absolute-file-name.error", uri);
        }
        name.delete(0, startPos);

        // Look for drive name
        String driveName = extractDrivePrefix(name);
        if (driveName != null)
        {
            return driveName;
        }

        // Look for UNC name
        if (startPos < 2)
        {
            throw new FileSystemException("vfs.provider.local/not-absolute-file-name.error", uri);
        }

        return "//" + extractUNCPrefix(uri, name);
    }
View Full Code Here

        {
        }
        pos++;
        if (pos >= maxpos)
        {
            throw new FileSystemException("vfs.provider.local/missing-share-name.error", uri);
        }

        // Now have <name> '/'
        int startShareName = pos;
        for (; pos < maxpos && name.charAt(pos) != '/'; pos++)
        {
        }
        if (pos == startShareName)
        {
            throw new FileSystemException("vfs.provider.local/missing-share-name.error", uri);
        }

        // Now have <name> '/' <name> ( '/' | <end> )
        String prefix = name.substring(0, pos);
        name.delete(0, pos);
View Full Code Here

                }
            };
        }
        catch (FileNotFoundException e)
        {
            throw new FileSystemException("vfs.provider/random-access-open-failed.error", localFile);
        }
    }
View Full Code Here

        // TODO - this class isn't generic at all.  Need to fix this

        // Looking for <sep>
        if (name.length() == 0 || name.charAt(0) != '/')
        {
            throw new FileSystemException("vfs.provider.local/not-absolute-file-name.error", uri);
        }

        // do not strip the separator, BUT also return it ...
        return "/";
    }
View Full Code Here

        else if (file.isFile())
        {
            return FileType.FILE;
        }

        throw new FileSystemException("vfs.provider.local/get-type.error", file);
    }
View Full Code Here

    protected void doDelete()
        throws Exception
    {
        if (!file.delete())
        {
            throw new FileSystemException("vfs.provider.local/delete-file.error", file);
        }
    }
View Full Code Here

     */
    protected void doRename(FileObject newfile) throws Exception
    {
        if (!file.renameTo(((LocalFile) newfile).getLocalFile()))
        {
            throw new FileSystemException("vfs.provider.local/rename-file.error",
                new String[]{file.toString(), newfile.toString()});
        }
    }
View Full Code Here

    protected void doCreateFolder()
        throws Exception
    {
        if (!file.mkdirs())
        {
            throw new FileSystemException("vfs.provider.local/create-folder.error", file);
        }
    }
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.