org.jboss.vfs.VFS.mountTemp()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(104)

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

VFS.mountTemp介绍

[英]Create and mount a temporary file system, returning a single handle which will unmount and close the filesystem when closed.
[中]创建并挂载一个临时文件系统,返回一个句柄,该句柄将在文件系统关闭时卸载并关闭文件系统。

代码示例

代码示例来源:origin: org.jboss.deployers/jboss-deployers-vfs

public void deploy(VFSDeploymentUnit unit) throws DeploymentException
{
 try
 {
   VirtualFile classes = VFS.getChild(createHost(unit));
   URL dynamicClassRoot = classes.toURL();
   Closeable closeable = VFS.mountTemp(classes, tempFileProvider);
   unit.addAttachment(MOUNT_HANDLE_KEY, closeable);
   unit.addAttachment(DYNAMIC_CLASS_KEY, classes);
   unit.addAttachment(DYNAMIC_CLASS_URL_KEY, dynamicClassRoot);
   unit.prependClassPath(classes);
   log.debug("Dynamic class root for " + unit.getName() + " is " + dynamicClassRoot);
 }
 catch (Exception e)
 {
   throw new DeploymentException("Error creating dynamic class root", e);
 }
}

代码示例来源:origin: wildfly/wildfly-core

Closeable closable = VFS.mountTemp(file, TempFileProviderService.provider());
deploymentUnit.addToAttachmentList(MOUNTED_FILES, closable);

代码示例来源:origin: org.wildfly.core/wildfly-server

Closeable closable = VFS.mountTemp(file, TempFileProviderService.provider());
deploymentUnit.addToAttachmentList(MOUNTED_FILES, closable);

相关文章