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; }
child = VFS.getChild(path.getPath().split("META-INF")[0]); closable = VFS.mountReal(new File(path.getPath().split("META-INF")[0]), child);
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 ); } }
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); }
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); }
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; }
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; }
@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); } }
@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); }
@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); }
@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); } }
@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); } }
@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); } }
@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); } }
@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); }
child = VFS.getChild(path.getPath().split("META-INF")[0]); closable = VFS.mountReal(new File(path.getPath().split("META-INF")[0]), child);
@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()); } } } } }
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);
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);
Closeable handle = VFS.mountReal(override.getContentHash().getPhysicalFile(), mountPoint); MountedDeploymentOverlay mounted = new MountedDeploymentOverlay(handle, override.getContentHash().getPhysicalFile(), mountPoint, TempFileProviderService.provider()); deploymentUnit.addToAttachmentList(MOUNTED_FILES, mounted);