@Override public URL getEntryAsURL(String entryPath) throws IOException { return files.containsKey(entryPath) ? files.get(entryPath).asFileURL() : null; }
private BeansXml parseBeansXml(VirtualFile beansXmlFile, PropertyReplacingBeansXmlParser parser, final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { try { return parser.parse(beansXmlFile.asFileURL()); } catch (MalformedURLException e) { throw WeldLogger.ROOT_LOGGER.couldNotGetBeansXmlAsURL(beansXmlFile.toString(), e); } catch (RuntimeException e) { throw new DeploymentUnitProcessingException(e); } } }
/** * Copies resources from WAR to target folder. * * @param virtualFileOrFolder * @param targetFolder * @throws IOException */ static void copyFromWarToFolder(VirtualFile virtualFileOrFolder, File targetFolder) throws IOException { if (virtualFileOrFolder.isDirectory() && !virtualFileOrFolder.getName().contains(".")) { if (targetFolder.getName().equalsIgnoreCase(virtualFileOrFolder.getName())) { for (VirtualFile innerFileOrFolder : virtualFileOrFolder.getChildren()) { copyFromWarToFolder(innerFileOrFolder, targetFolder); } } else { File innerTargetFolder = new File(targetFolder, virtualFileOrFolder.getName()); innerTargetFolder.mkdir(); for (VirtualFile innerFileOrFolder : virtualFileOrFolder.getChildren()) { copyFromWarToFolder(innerFileOrFolder, innerTargetFolder); } } } else { File targetFile = new File(targetFolder, virtualFileOrFolder.getName()); if (!targetFile.exists() || targetFile.length() != virtualFileOrFolder.getSize()) { FileUtils.copyURLToFile(virtualFileOrFolder.asFileURL(), targetFile); } } } }
@Override public URL getEntryAsURL(String entryPath) throws IOException { return files.containsKey(entryPath) ? files.get(entryPath).asFileURL() : null; }
@Override public URL getEntryAsURL(String entryPath) throws IOException { return files.containsKey(entryPath) ? files.get(entryPath).asFileURL() : null; }
private URL asFileURL(VirtualFile vf) { URL url = null; if (vf != null && vf.exists()) { try { url = vf.asFileURL(); } catch (MalformedURLException e) { // ignore } } return url; } }
private URL asFileURL(VirtualFile vf) { URL url = null; if (vf != null && vf.exists()) { try { url = vf.asFileURL(); } catch (MalformedURLException e) { // ignore } } return url; } }
@Override protected URL getConfigFile(String configFileName) throws IOException { return root.getChild(configFileName).asFileURL(); }
@Override protected URL getConfigFile(String configFileName) throws IOException { return root.getChild(configFileName).asFileURL(); }
/** * Construct new instance. * * @param rootName The module root name * @param root The root virtual file * @param usePhysicalCodeSource {@code true} to use the physical root URL for code sources, {@code false} to use the VFS URL * @throws IOException if the manifest could not be read or the root URL is invalid */ public VFSResourceLoader(final String rootName, final VirtualFile root, final boolean usePhysicalCodeSource) throws IOException { this.root = root; this.rootName = rootName; manifest = VFSUtils.getManifest(root); rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL(); }
rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL();
rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL();
rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL();
private BeansXml parseBeansXml(VirtualFile beansXmlFile, BeansXmlParser parser, final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { try { return parser.parse(beansXmlFile.asFileURL(), SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit)); } catch (MalformedURLException e) { throw WeldMessages.MESSAGES.couldNotGetBeansXmlAsURL(beansXmlFile.toString(), e); } }
boolean addedAny = false; if (runtimeName.endsWith(CamelConstants.CAMEL_CONTEXT_FILE_SUFFIX)) { URL fileURL = depUnit.getAttachment(Attachments.DEPLOYMENT_CONTENTS).asFileURL(); addedAny |= addConditionally(depUnit, depSettings, fileURL); } else { VirtualFile rootFile = depUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); for (VirtualFile vfile : rootFile.getChildrenRecursively(filter)) { addedAny |= addConditionally(depUnit, depSettings, vfile.asFileURL());
boolean addedAny = false; if (runtimeName.endsWith(CamelConstants.CAMEL_CONTEXT_FILE_SUFFIX)) { URL fileURL = depUnit.getAttachment(Attachments.DEPLOYMENT_CONTENTS).asFileURL(); addedAny |= addConditionally(depUnit, depSettings, fileURL); } else { VirtualFile rootFile = depUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); for (VirtualFile vfile : rootFile.getChildrenRecursively(filter)) { addedAny |= addConditionally(depUnit, depSettings, vfile.asFileURL());