protected String getFilePath(VirtualFile file) { String path = null; try { path = file.toURI().toString(); } catch(Exception e) { } return path; }
@Override protected void init(VFSDeploymentUnit unit, KernelDeployment metaData, VirtualFile file) throws Exception { String name = file.toURI().toString(); metaData.setName(name); }
@Override protected void init(VFSDeploymentUnit unit, KernelDeployment metaData, VirtualFile file) throws Exception { String name = file.toURI().toString(); metaData.setName(name); }
/** * Get the path name for the VirtualFile. * * @param file the virtual file * @return the path name */ protected String getPathName(VirtualFile file) { try { // prefer the URI, as the pathName might // return an empty string for temp virtual files return file.toURI().toString(); } catch (Exception e) { return file.getPathName(); } } }
/** * Get the vfs file name safely * * @param root the virutal file * @return the name */ static String safeVirtualFileName(VirtualFile root) { if (root == null) throw new IllegalArgumentException("Null root"); try { return root.toURI().toString(); } catch (Exception e) { return root.getName(); } }
/** * Get the vfs file name safely * * @param root the virutal file * @return the name */ static final String safeVirtualFileName(VirtualFile root) { if (root == null) throw new IllegalArgumentException("Null root"); try { return root.toURI().toString(); } catch (Exception e) { return root.getName(); } }
@Override protected ManagedConnectionFactoryDeploymentGroup parse(VFSDeploymentUnit unit, VirtualFile file, ManagedConnectionFactoryDeploymentGroup root) throws Exception { //TODO do we need to this every time? Unmarshaller um = context.createUnmarshaller(); InputStream is = file.openStream(); try { InputSource input = new InputSource(is); input.setSystemId(file.toURI().toString()); XMLReader reader = XMLReaderFactory.createXMLReader(); reader.setEntityResolver(new JBossEntityResolver()); SAXSource source = new SAXSource(reader, input); JAXBElement<ManagedConnectionFactoryDeploymentGroup> elem = um.unmarshal(source, ManagedConnectionFactoryDeploymentGroup.class); ManagedConnectionFactoryDeploymentGroup deployment = elem.getValue(); repository.addManagedConnectionFactoryDeploymentGroup(deployment); return deployment; } finally { if (is != null) is.close(); } }
protected ServiceDeployment parse(VFSDeploymentUnit unit, VirtualFile file, Document document) throws Exception { ServiceDeploymentParser parser = new ServiceDeploymentParser(document); ServiceDeployment parsed = parser.parse(); String name = file.toURI().toString(); parsed.setName(name); return parsed; } }
public byte[] addContent(Archive<?> archive) throws IOException, URISyntaxException { try { MessageDigest messageDigest = MessageDigest.getInstance("SHA-1"); byte[] sha1Bytes; messageDigest.reset(); BufferedInputStream bis = new BufferedInputStream(archive.as(ZipExporter.class).exportAsInputStream()); byte[] bytes = new byte[8192]; int read; while ((read = bis.read(bytes)) > -1) { messageDigest.update(bytes, 0, read); } sha1Bytes = messageDigest.digest(); String key = toKey(sha1Bytes); this.fs.addArchive(archive.getName(), archive); this.index.put(key, this.fsMount.getChild(archive.getName()).toURI()); return sha1Bytes; } catch (NoSuchAlgorithmException e) { throw new IOException(e); } }
public byte[] addContent(Archive<?> archive) throws IOException, URISyntaxException { try { MessageDigest messageDigest = MessageDigest.getInstance("SHA-1"); byte[] sha1Bytes; messageDigest.reset(); BufferedInputStream bis = new BufferedInputStream(archive.as(ZipExporter.class).exportAsInputStream()); byte[] bytes = new byte[8192]; int read; while ((read = bis.read(bytes)) > -1) { messageDigest.update(bytes, 0, read); } sha1Bytes = messageDigest.digest(); String key = toKey(sha1Bytes); this.fs.addArchive(archive.getName(), archive); this.index.put(key, this.fsMount.getChild(archive.getName()).toURI()); return sha1Bytes; } catch (NoSuchAlgorithmException e) { throw new IOException(e); } }
public byte[] addContent(Archive<?> archive) throws IOException, URISyntaxException { try { MessageDigest messageDigest = MessageDigest.getInstance("SHA-1"); byte[] sha1Bytes; messageDigest.reset(); BufferedInputStream bis = new BufferedInputStream(archive.as(ZipExporter.class).exportAsInputStream()); byte[] bytes = new byte[8192]; int read; while ((read = bis.read(bytes)) > -1) { messageDigest.update(bytes, 0, read); } sha1Bytes = messageDigest.digest(); String key = toKey(sha1Bytes); this.fs.addArchive(archive.getName(), archive); this.index.put(key, this.fsMount.getChild(archive.getName()).toURI()); return sha1Bytes; } catch (NoSuchAlgorithmException e) { throw new IOException(e); } }
public boolean hasStructureBeenModified(VirtualFile root) throws IOException { VFSDeploymentContext deploymentContext = null; try { String name = root.toURI().toString(); deploymentContext = getDeploymentContext(name); } catch (URISyntaxException ignore) { } if(deploymentContext == null) { log.trace("Falling back to root name: " + root); deploymentContext = getDeploymentContext(root.getName()); } return hasStructureBeenModified(root, deploymentContext); }
@Override protected T parse(VFSDeploymentUnit unit, VirtualFile file, T root) throws Exception { if (file == null) throw new IllegalArgumentException("Null file"); Document document = doParse(unit, file); Transformer trans = getTemplates().newTransformer(); trans.setErrorListener(new JBossErrorHandler(file.getPathName(), null)); Source s = new DOMSource(document); s.setSystemId(file.toURI().toString()); DOMResult r = new DOMResult(); setParameters(trans); trans.transform(s, r); document = (Document) r.getNode(); String docStr = DOMWriter.printNode(document, true); log.debugf("Transformed %1s into %2s", file.getPathName(), docStr); return parse(unit, file, document); }
String name = file.toURI().toString(); parsed.setName(name);
if (module.exists() == false) throw new RuntimeException(fileName + " module listed in application.xml does not exist within .ear " + file.toURI());