org.apache.commons.vfs.VFS类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.apache.commons.vfs.VFS类的一些代码示例,展示了VFS类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VFS类的具体详情如下:
包路径:org.apache.commons.vfs.VFS
类名称:VFS

VFS介绍

[英]The main entry point for the VFS. Used to create FileSystemManagerinstances.
[中]VFS的主要入口点。用于创建文件系统管理实例。

代码示例

代码示例来源:origin: uk.org.mygrid.taverna/taverna-contrib

public RepositoryManager() {
  try {
    fsManager = VFS.getManager();
  } catch (FileSystemException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

/**
 * Returns the default {@link FileSystemManager} instance
 */
public static synchronized FileSystemManager getManager()
  throws FileSystemException
{
  if (instance == null)
  {
    instance = createManager("org.apache.commons.vfs.impl.StandardFileSystemManager");
  }
  return instance;
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

/**
 * Returns the absolute path of the file, relative to the root of the
 * file system that the file belongs to.
 */
public String getPath()
{
  if (VFS.isUriStyle())
  {
    return absPath + getUriTrailer();
  }
  return absPath;
}

代码示例来源:origin: org.jbpm/jbpm-form-services

protected void writeToURL(URL url, String json) throws FileNotFoundException, IOException {
  if (url.toExternalForm().startsWith("vfs")) {
    FileObject to = VFS.getManager().resolveFile(url.toExternalForm());
    File tmpFile = File.createTempFile("xxFilexx", ".json");
    FileUtils.writeStringToFile(tmpFile, json);
    FileObject from = VFS.getManager().toFileObject(tmpFile);
    to.copyFrom(from, new AllFileSelector());
    FileUtils.deleteQuietly(tmpFile);
  } else {
    FileUtils.writeStringToFile(FileUtils.toFile(url), json);
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

if (VFS.isUriStyle())

代码示例来源:origin: org.jbpm/form-services

protected void writeToURL(URL url, String json) throws FileNotFoundException, IOException {
  if (url.toExternalForm().startsWith("vfs")) {
    FileObject to = VFS.getManager().resolveFile(url.toExternalForm());
    File tmpFile = File.createTempFile("xxFilexx", ".json");
    FileUtils.writeStringToFile(tmpFile, json);
    FileObject from = VFS.getManager().toFileObject(tmpFile);
    to.copyFrom(from, new AllFileSelector());
    FileUtils.deleteQuietly(tmpFile);
  } else {
    FileUtils.writeStringToFile(FileUtils.toFile(url), json);
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

if (!VFS.isUriStyle())

代码示例来源:origin: org.jbpm/form-services

protected String readURL(URL url) throws FileNotFoundException, IOException {
    if (url.toExternalForm().startsWith("vfs")) {
      FileObject from = VFS.getManager().resolveFile(url.toExternalForm());
      return IOUtils.toString(from.getContent().getInputStream());
    } else {
      return FileUtils.readFileToString(FileUtils.toFile(url));
    }
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

if (VFS.isUriStyle())

代码示例来源:origin: org.jbpm/jbpm-form-services

protected String readURL(URL url) throws FileNotFoundException, IOException {
    if (url.toExternalForm().startsWith("vfs")) {
      FileObject from = VFS.getManager().resolveFile(url.toExternalForm());
      return IOUtils.toString(from.getContent().getInputStream());
    } else {
      return FileUtils.readFileToString(FileUtils.toFile(url));
    }
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

if (base != null && VFS.isUriStyle() && base.getType() == FileType.FILE)
  if (!VFS.isUriStyle())

代码示例来源:origin: net.sourceforge.tink/tink-model

protected void logout() throws TinkException, IOException
{
  VFS.getManager().closeFileSystem(remote.getFileSystem());
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

if (baseFile != null && VFS.isUriStyle()
    && baseFile.getName().getType() == FileType.FILE)

代码示例来源:origin: org.apache.excalibur.components/excalibur-sourceresolve

/**
 * Constructor, creates instance of class.
 *
 * @param location location to resolve
 * @param parameters protocol specific parameters
 * @throws FileSystemException if an error occurs
 */
public CommonsVFSSource(final String location, final Map parameters)
  throws FileSystemException {
  m_location = location;
  m_manager = VFS.getManager();
  m_fileObject = m_manager.resolveFile(location); // REVISIT: parameters
  m_fileContent = m_fileObject.getContent();
}

代码示例来源:origin: violetumleditor/violetumleditor

FileSystemManager fsManager = VFS.getManager();
List<FileObject> innerJarFiles = new ArrayList<FileObject>();
String classPathContent = System.getProperty("java.class.path");

代码示例来源:origin: org.motechproject/motech-platform-server-config

private void setupLocation() throws FileSystemException {
  ConfigLocation configLocation = coreConfigurationService.getConfigLocation();
  monitoredDir = VFS.getManager().resolveFile(configLocation.getLocation());
  fileMonitor.addFile(monitoredDir);
  LOGGER.info(String.format("Setting up monitoring for location: %s", monitoredDir));
}

代码示例来源:origin: org.apache.kalumet/org.apache.kalumet.common

/**
 * Private constructor to init the singleton.
 *
 * @throws FileManipulatorException in <code>FileManipulator</code> init failed.
 */
public FileManipulator()
 throws FileManipulatorException
{
 try
 {
  LOGGER.debug( "Creating VFS file system manager ..." );
  this.fileSystemManager = VFS.getManager();
  // this.fileSystemManager = new StandardFileSystemManager();
  // fileSystemManager.setCacheStrategy(CacheStrategy.ON_CALL);
  ( (StandardFileSystemManager) this.fileSystemManager ).setReplicator( new KalumetFileReplicator() );
  // fileSystemManager.init();
 }
 catch ( Exception e )
 {
  throw new FileManipulatorException( e );
 }
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * Creates a VFS file handler with the default file system manager.
 */
public VFSFileHandler()
{
  try
  {
    this.fileSystemManager = VFS.getManager();
  }
  catch (FileSystemException e)
  {
    throw new CargoException("Failed to get VFS system manager", e);
  }
}

代码示例来源:origin: uk.org.mygrid.taverna/taverna-contrib

/**
 * Constructor
 * 
 * @param rootFileUrl
 *            The root directory of the repository.
 */
public LocalRepository(String rootFileUrl) {
  try {
    this.setFsManager(VFS.getManager());
    this.root = this.fsManager.resolveFile(rootFileUrl);
    this.fsManager.createFileSystem(root);
  } catch (FileSystemException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: uk.org.mygrid.taverna/taverna-contrib

/**
 * Constructor
 * 
 * @param rootFileUrl
 */
public WebDAVRepository(String rootFileUrl) {
  try {
    this.setFsManager(VFS.getManager());
    this.root = this.fsManager.resolveFile(rootFileUrl);
    this.fsManager.createFileSystem(root);
  } catch (FileSystemException e) {
    e.printStackTrace();
  }
}

相关文章

VFS类方法