本文整理匯總了Java中org.apache.commons.vfs2.FileObject.isWriteable方法的典型用法代碼示例。如果您正苦於以下問題:Java FileObject.isWriteable方法的具體用法?Java FileObject.isWriteable怎麽用?Java FileObject.isWriteable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.vfs2.FileObject
的用法示例。
在下文中一共展示了FileObject.isWriteable方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.apache.commons.vfs2.FileObject; //導入方法依賴的package包/類
@Override
public void init(String storeId) {
super.init(storeId);
uri = MCRConfiguration.instance().getString(storeConfigPrefix + "URI");
String check = MCRConfiguration.instance().getString(storeConfigPrefix + "StrictHostKeyChecking", "no");
try {
fsManager = VFS.getManager();
opts = new FileSystemOptions();
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts, check);
FileObject baseDir = getBase();
// Create a folder, if it does not exist or throw an
// exception, if baseDir is not a folder
baseDir.createFolder();
if (!baseDir.isWriteable()) {
String msg = "Content store base directory is not writeable: " + uri;
throw new MCRConfigurationException(msg);
}
} catch (FileSystemException ex) {
throw new MCRException(ex.getCode(), ex);
}
}