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

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

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

VFS.mountReal介绍

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

代码示例

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

private Closeable exportExplodedWar(final boolean war, final VirtualFile file, final DeploymentUnit deploymentUnit) throws IOException {
  if (isExplodedWarInArchiveEar(war, file, deploymentUnit)) {
    File warContent = file.getPhysicalFile();
    VFSUtils.recursiveCopy(file, warContent.getParentFile());
    return VFS.mountReal(warContent, file);
  }
  return null;
}

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

child = VFS.getChild(path.getPath().split("META-INF")[0]);
closable = VFS.mountReal(new File(path.getPath().split("META-INF")[0]), child);

代码示例来源:origin: org.projectodd/polyglot-core

protected void mountDir(DeploymentUnit unit, VirtualFile root, String name, String path) throws IOException {
    VirtualFile logical = root.getChild( name );
    File physical = new File( path );
    physical.mkdirs();
    Closeable mount = VFS.mountReal( physical, logical );
    unit.addToAttachmentList( CLOSEABLE_ATTACHMENTS_KEY, mount );
  }
}

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

public void add(final String path, final File root) throws IOException {
  VirtualFile mountPoint = mountRoot.getChild(path);
  Closeable handle = VFS.mountReal(root, mountPoint);
  mountHandles.add(handle);
  add(path, mountPoint);
}

代码示例来源:origin: org.jboss.ejb3.embedded/jboss-ejb3-embedded-sub

public void add(final String path, final File root) throws IOException {
 VirtualFile mountPoint = mountRoot.getChild(path);
 Closeable handle = VFS.mountReal(root, mountPoint);
 mountHandles.add(handle);
 add(path, mountPoint);
}

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

private Closeable exportExplodedWar(final boolean war, final VirtualFile file, final DeploymentUnit deploymentUnit) throws IOException {
  if (isExplodedWarInArchiveEar(war, file, deploymentUnit)) {
    File warContent = file.getPhysicalFile();
    VFSUtils.recursiveCopy(file, warContent.getParentFile());
    return VFS.mountReal(warContent, file);
  }
  return null;
}

代码示例来源:origin: org.jboss.eap/wildfly-ee

private Closeable exportExplodedWar(final boolean war, final VirtualFile file, final DeploymentUnit deploymentUnit) throws IOException {
  if (isExplodedWarInArchiveEar(war, file, deploymentUnit)) {
    File warContent = file.getPhysicalFile();
    VFSUtils.recursiveCopy(file, warContent.getParentFile());
    return VFS.mountReal(warContent, file);
  }
  return null;
}

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

@SuppressWarnings({"UnusedDeclaration"})
protected void mountLinks(StructureContext context, VirtualFile parent, String path, List<LinkInfo> links) throws IOException
{
 VirtualFile root = context.getFile();
 VirtualFile link = parent.getChild(path);
 for (LinkInfo li : links)
 {
   VirtualFile linkChild = link.getChild(li.name);
   Closeable closeable = VFS.mountReal(new File(li.uri), linkChild);
   Automounter.addHandle(root, closeable);
 }
}

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

@Override
protected void handleExplodedEntryWithDirParent(DeploymentUnit deploymentUnit, VirtualFile content, VirtualFile mountPoint,
    Map<String, MountedDeploymentOverlay> mounts, String overLayPath) throws IOException {
  Closeable handle = VFS.mountReal(content.getPhysicalFile(), mountPoint);
  MountedDeploymentOverlay mounted = new MountedDeploymentOverlay(handle, content.getPhysicalFile(), mountPoint, TempFileProviderService.provider());
  deploymentUnit.addToAttachmentList(MOUNTED_FILES, mounted);
  mounts.put(overLayPath, mounted);
}

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

@Override
protected void handleExplodedEntryWithDirParent(DeploymentUnit deploymentUnit, VirtualFile content, VirtualFile mountPoint,
    Map<String, MountedDeploymentOverlay> mounts, String overLayPath) throws IOException {
  Closeable handle = VFS.mountReal(content.getPhysicalFile(), mountPoint);
  MountedDeploymentOverlay mounted = new MountedDeploymentOverlay(handle, content.getPhysicalFile(), mountPoint, TempFileProviderService.provider());
  deploymentUnit.addToAttachmentList(MOUNTED_FILES, mounted);
  mounts.put(overLayPath, mounted);
}

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

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerLogger.ROOT_LOGGER.unknownMountType(type);
  }
}

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

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerMessages.MESSAGES.unknownMountType(type);
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-server

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerMessages.MESSAGES.unknownMountType(type);
  }
}

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

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerLogger.ROOT_LOGGER.unknownMountType(type);
  }
}

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

@BeforeClass public static void beforeClass() throws IOException {
  FileWriter f = new FileWriter(UnitTestUtil.getTestScratchPath()+"/foo");
  f.write("ResourceContents");
  f.close();
  
  root = VFS.getChild("location");
  fileMount = VFS.mountReal(new File(UnitTestUtil.getTestScratchPath()), root);		
}

代码示例来源:origin: org.jboss.eap/wildfly-connector

child = VFS.getChild(path.getPath().split("META-INF")[0]);
closable = VFS.mountReal(new File(path.getPath().split("META-INF")[0]), child);

代码示例来源:origin: org.jboss.as/jboss-as-server

@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
  final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
  if (deploymentUnit.getParent() != null) {
    return;
  }
  final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
  final Set<String> paths = new HashSet<String>();
  for (final DeploymentOverlayService deploymentOverlay : indexService.getOverrides(deploymentUnit.getName())) {
    for (final ContentService override : deploymentOverlay.getContentServices()) {
      if (!paths.contains(override.getPath())) {
        paths.add(override.getPath());
        try {
          Closeable handle = VFS.mountReal(override.getContentHash().getPhysicalFile(), deploymentRoot.getRoot().getChild(override.getPath()));
          deploymentUnit.addToAttachmentList(MOUNTED_FILES, handle);
        } catch (IOException e) {
          throw ServerMessages.MESSAGES.deploymentOverlayFailed(e, deploymentOverlay.getName(), override.getPath());
        }
      }
    }
  }
}

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

deploymentUnit.addToAttachmentList(MOUNTED_FILES, closable);
Closeable handle = VFS.mountReal(content.getPhysicalFile(), mountPoint);
MountedDeploymentOverlay mounted = new MountedDeploymentOverlay(handle, content.getPhysicalFile(), mountPoint, TempFileProviderService.provider());
deploymentUnit.addToAttachmentList(MOUNTED_FILES, mounted);

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

deploymentUnit.addToAttachmentList(MOUNTED_FILES, closable);
Closeable handle = VFS.mountReal(content.getPhysicalFile(), mountPoint);
MountedDeploymentOverlay mounted = new MountedDeploymentOverlay(handle, content.getPhysicalFile(), mountPoint, TempFileProviderService.provider());
deploymentUnit.addToAttachmentList(MOUNTED_FILES, mounted);

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

Closeable handle = VFS.mountReal(override.getContentHash().getPhysicalFile(), mountPoint);
MountedDeploymentOverlay mounted = new MountedDeploymentOverlay(handle, override.getContentHash().getPhysicalFile(),  mountPoint, TempFileProviderService.provider());
deploymentUnit.addToAttachmentList(MOUNTED_FILES, mounted);

相关文章