本文整理汇总了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;
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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;
}
示例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());
}
}