本文整理汇总了Java中org.apache.commons.vfs2.FileSystemException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java FileSystemException.printStackTrace方法的具体用法?Java FileSystemException.printStackTrace怎么用?Java FileSystemException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.vfs2.FileSystemException
的用法示例。
在下文中一共展示了FileSystemException.printStackTrace方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfiguration
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
public Configuration getConfiguration()
{
if (_config == null)
{
Map utils = new HashMap();
utils.put("util", new Utils(this));
try
{
VFSUtils.init();
}
catch (FileSystemException e)
{
e.printStackTrace();
}
_config = new YajswConfigurationImpl(_localConfiguration,
_useSystemProperties, utils);
}
return _config;
}
示例2: fileExists
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
private boolean fileExists(String file)
{
try
{
// this hack is no longer required, changed VFS to init without
// providers.xm.
// String current =
// System.getProperty("javax.xml.parsers.DocumentBuilderFactory");
// System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
// "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
DefaultFileSystemManager fsManager = (DefaultFileSystemManager) VFS
.getManager();
// if (current != null)
// System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
// current);
// else
// System.clearProperty("javax.xml.parsers.DocumentBuilderFactory");
FileObject f = VFSUtils.resolveFile(".", file);
return f.exists();
}
catch (FileSystemException e)
{
e.printStackTrace();
return false;
}
}
示例3: start
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
/**
* Starts watching the file system for changes to trigger a bake.
*
* @param res Commandline options
* @param config Configuration settings
*/
public void start(final LaunchOptions res, CompositeConfiguration config) {
try {
FileSystemManager fsMan = VFS.getManager();
FileObject listenPath = fsMan.resolveFile(res.getSource(), config.getString( ConfigUtil.Keys.CONTENT_FOLDER));
System.out.println("Watching for changes in [" + res.getSource() + "]");
DefaultFileMonitor monitor = new DefaultFileMonitor(new CustomFSChangeListener(res, config));
monitor.setRecursive(true);
monitor.addFile(listenPath);
monitor.start();
} catch (FileSystemException e) {
e.printStackTrace();
}
}
示例4: fileChanged
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
private boolean fileChanged(FileObject source, FileObject destination)
{
try
{
return !destination.exists()
|| source.getContent().getLastModifiedTime() == 0
|| source.getContent().getLastModifiedTime() != destination
.getContent().getLastModifiedTime();
}
catch (FileSystemException e)
{
e.printStackTrace();
return true;
}
}
示例5: getFileName
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
public String getFileName()
{
//return _fileName;
try {
return VFSUtils.resolveFile(".", _fileName).getName().getBaseName();
} catch (FileSystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return _fileName;
}
示例6: getLastModifiedTime
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
public static long getLastModifiedTime(FileObject file)
{
try
{
return file.getContent().getLastModifiedTime();
}
catch (FileSystemException e)
{
e.printStackTrace();
return 0;
}
}
示例7: isLocal
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
public static boolean isLocal(FileObject f)
{
if (f instanceof OnCallRefreshFileObject)
try
{
return f.getContent().getFile() instanceof LocalFile;
}
catch (FileSystemException e)
{
e.printStackTrace();
}
return f instanceof LocalFile;
}
示例8: getHighestStoredID
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
public synchronized int getHighestStoredID() {
int found = 0;
try {
String max;
max = findMaxID(baseDirectory, 0);
if (max != null) {
found = slot2id(max);
}
} catch (final FileSystemException e) {
e.printStackTrace();
}
return found;
}
示例9: isEmpty
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
public boolean isEmpty() {
try {
return baseDirectory.getChildren().length == 0;
} catch (final FileSystemException e) {
e.printStackTrace();
}
return false;
}
示例10: close
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
@Override
public void close(FileObject fileObject) {
try {
fileObject.close();
} catch (FileSystemException e) {
e.printStackTrace();
}
}
示例11: getAuthenticationData
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
@Override
protected void getAuthenticationData(UserAuthenticationData authenticationData) {
super.getAuthenticationData(authenticationData);
authenticationData.setData(UserAuthenticationDataWrapper.SSH_KEY, sshKeyFileField.getText().trim().toCharArray());
if (StringUtils.isNotBlank(sshKeyFileField.getText())) {
try {
SftpFileSystemConfigBuilder.getInstance().setIdentities(getFileSystemOptions(), new File[]{new File(sshKeyFileField.getText())});
//TODO set user auth data file path
} catch (FileSystemException e) {
e.printStackTrace();
}
}
}
示例12: fileNameString
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
private String fileNameString(FileObject fileObject)
{
if (fileObject == null)
{
return null;
}
else
{
VFSJFileChooser fc = getFileChooser();
if ((fc.isDirectorySelectionEnabled() &&
!fc.isFileSelectionEnabled()) ||
(fc.isDirectorySelectionEnabled() &&
fc.isFileSelectionEnabled() &&
fc.getFileSystemView().isFileSystemRoot(fileObject)))
{
String url = null;
try
{
url = fileObject.getURL().toExternalForm();
}
catch (FileSystemException ex)
{
ex.printStackTrace();
}
return url;
}
else
{
return fileObject.getName().getBaseName();
}
}
}
示例13: doDirectoryChanged
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
private void doDirectoryChanged(PropertyChangeEvent e)
{
VFSJFileChooser fc = getFileChooser();
AbstractVFSFileSystemView fsv = fc.getFileSystemView();
clearIconCache();
FileObject currentDirectory = fc.getCurrentDirectoryObject();
if (currentDirectory != null)
{
directoryComboBoxModel.addItem(currentDirectory);
directoryComboBox.setSelectedItem(currentDirectory);
fc.setCurrentDirectoryObject(currentDirectory);
if (fc.isDirectorySelectionEnabled() &&
!fc.isFileSelectionEnabled())
{
if (fsv.isFileSystem(currentDirectory))
{
String url = null;
try
{
url = currentDirectory.getURL().toExternalForm();
}
catch (FileSystemException e1)
{
e1.printStackTrace();
}
setFileName(url);
}
else
{
setFileName(null);
}
}
}
}
示例14: doFileSelectionModeChanged
import org.apache.commons.vfs2.FileSystemException; //导入方法依赖的package包/类
private void doFileSelectionModeChanged(PropertyChangeEvent e)
{
if (fileNameLabel != null)
{
populateFileNameLabel();
}
clearIconCache();
VFSJFileChooser fc = getFileChooser();
FileObject currentDirectory = fc.getCurrentDirectoryObject();
if ((currentDirectory != null) && fc.isDirectorySelectionEnabled() &&
!fc.isFileSelectionEnabled() &&
fc.getFileSystemView().isFileSystem(currentDirectory))
{
String url = null;
try
{
url = currentDirectory.getURL().toExternalForm();
}
catch (FileSystemException e1)
{
e1.printStackTrace();
}
setFileName(url);
}
else
{
setFileName(null);
}
}