当前位置: 首页>>代码示例>>Java>>正文


Java FileSystemException.getMessage方法代码示例

本文整理汇总了Java中org.apache.commons.vfs.FileSystemException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java FileSystemException.getMessage方法的具体用法?Java FileSystemException.getMessage怎么用?Java FileSystemException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.vfs.FileSystemException的用法示例。


在下文中一共展示了FileSystemException.getMessage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onChildrenChanged

import org.apache.commons.vfs.FileSystemException; //导入方法依赖的package包/类
/**
 * Called when the children of this file change.
 */
protected void onChildrenChanged(FileName child, FileType newType)
{
    if (children != null && newType.equals(FileType.IMAGINARY))
    {
        try
        {
            children.remove(UriParser.decode(child.getBaseName()));
        }
        catch (FileSystemException e)
        {
            throw new RuntimeException(e.getMessage());
        }
    }
    else
    {
        // if child was added we have to rescan the children
        // TODO - get rid of this
        children = null;
    }
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:24,代码来源:FtpFileObject.java

示例2: compareTo

import org.apache.commons.vfs.FileSystemException; //导入方法依赖的package包/类
/**
 * Implement Comparable.
 *
 * @param obj another abstractfilename
 * @return negative number if less than, 0 if equal, postive if greater than.
 */
public int compareTo(Object obj)
{
    final AbstractFileName name = (AbstractFileName) obj;
    int ret = getRootURI().compareTo(name.getRootURI());
    if (ret != 0)
    {
        return ret;
    }

    // return absPath.compareTo(name.absPath);
    try
    {
        return getPathDecoded().compareTo(name.getPathDecoded());
    }
    catch (FileSystemException e)
    {
        throw new RuntimeException(e.getMessage());
    }
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:26,代码来源:AbstractFileName.java

示例3: parseURL

import org.apache.commons.vfs.FileSystemException; //导入方法依赖的package包/类
protected void parseURL(final URL u,
                        final String spec,
                        final int start,
                        final int limit)
{
    try
    {
        FileObject old = context.resolveFile(u.toExternalForm(), fileSystemOptions);

        FileObject newURL;
        if (start > 0 && spec.charAt(start - 1) == ':')
        {
            newURL = context.resolveFile(old, spec, fileSystemOptions);
        }
        else
        {
            if (old.getType() == FileType.FILE && old.getParent() != null)
            {
                // for files we have to resolve relative
                newURL = old.getParent().resolveFile(spec);
            }
            else
            {
                newURL = old.resolveFile(spec);
            }
        }

        final String url = newURL.getName().getURI();
        final StringBuffer filePart = new StringBuffer();
        final String protocolPart = UriParser.extractScheme(url, filePart);

        setURL(u, protocolPart, "", -1, null, null, filePart.toString(), null, null);
    }
    catch (FileSystemException fse)
    {
        // This is rethrown to MalformedURLException in URL anyway
        throw new RuntimeException(fse.getMessage());
    }
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:40,代码来源:DefaultURLStreamHandler.java

示例4: getContentType

import org.apache.commons.vfs.FileSystemException; //导入方法依赖的package包/类
public String getContentType()
{
    try
    {
        return content.getContentInfo().getContentType();
    }
    catch (FileSystemException e)
    {
        throw new RuntimeException(e.getMessage());
    }
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:12,代码来源:DefaultURLConnection.java

示例5: getContentEncoding

import org.apache.commons.vfs.FileSystemException; //导入方法依赖的package包/类
public String getContentEncoding()
{
    try
    {
        return content.getContentInfo().getContentEncoding();
    }
    catch (FileSystemException e)
    {
        throw new RuntimeException(e.getMessage());
    }
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:12,代码来源:DefaultURLConnection.java

示例6: setFileType

import org.apache.commons.vfs.FileSystemException; //导入方法依赖的package包/类
private void setFileType(FileType type)
{
    if (type != null && type != FileType.IMAGINARY)
    {
        try
        {
            name.setType(type);
        }
        catch (FileSystemException e)
        {
            throw new RuntimeException(e.getMessage());
        }
    }
    this.type = type;
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:16,代码来源:AbstractFileObject.java

示例7: getPermissions

import org.apache.commons.vfs.FileSystemException; //导入方法依赖的package包/类
/**
 * Calls super.getPermissions both for the code source and also
 * adds the permissions granted to the parent layers.
 * @param cs the CodeSource.
 * @return The PermissionCollections.
 */
protected PermissionCollection getPermissions(final CodeSource cs)
{
    try
    {
        final String url = cs.getLocation().toString();
        FileObject file = lookupFileObject(url);
        if (file == null)
        {
            return super.getPermissions(cs);
        }

        FileObject parentLayer = file.getFileSystem().getParentLayer();
        if (parentLayer == null)
        {
            return super.getPermissions(cs);
        }

        Permissions combi = new Permissions();
        PermissionCollection permCollect = super.getPermissions(cs);
        copyPermissions(permCollect, combi);

        for (FileObject parent = parentLayer;
             parent != null;
             parent = parent.getFileSystem().getParentLayer())
        {
            final CodeSource parentcs =
                new CodeSource(parent.getURL(),
                    parent.getContent().getCertificates());
            permCollect = super.getPermissions(parentcs);
            copyPermissions(permCollect, combi);
        }

        return combi;
    }
    catch (final FileSystemException fse)
    {
        throw new SecurityException(fse.getMessage());
    }
}
 
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:46,代码来源:VFSClassLoader.java


注:本文中的org.apache.commons.vfs.FileSystemException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。