Examples of VirtualFile


Examples of org.jboss.vfs.VirtualFile

    */
   VirtualFile backup(String profileName, String name, VirtualFile original) throws IOException
   {
      File realFile = original.getPhysicalFile();
      String hash = Integer.toHexString(realFile.toURI().hashCode());
      VirtualFile backup = originals.getChild(profileName).getChild(hash + realFile.getName());
      Closeable closeable = VFS.mountReal(realFile, backup);
      mounts.put(name, closeable);
      return backup;
   }
View Full Code Here

Examples of org.jboss.vfs.VirtualFile

      if (classpath == null && unit instanceof VFSDeploymentUnit)
      {
         VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
         try
         {
            VirtualFile classes = vfsUnit.getFile("WEB-INF/classes");
            // Tomcat can't handle the vfs urls yet
            URL vfsURL = classes.toURL();
            String vfsurl = vfsURL.toString();
            if (vfsurl.startsWith("vfs"))
               vfsURL = new URL(vfsurl.substring(3));
            classpath = new ArrayList<URL>();
            classpath.add(vfsURL);
View Full Code Here

Examples of org.jboss.vfs.VirtualFile

               }
               URL configUrl = new URL(configPath);
               standardJBossXmlPath = new URL(configUrl, "standardjboss.xml");
            }

            VirtualFile stdJBoss = VFS.getChild(standardJBossXmlPath);
            if (stdJBoss == null && ignoreMissingStandardJBossXml == false)
            {
               throw new DeploymentException("standardjboss.xml not found in config dir: " + standardJBossXmlPath);
            }
            standardMetaData = super.parse(stdJBoss);
View Full Code Here

Examples of org.jboss.vfs.VirtualFile

   public void deploy(VFSDeploymentUnit unit, JBossAppMetaData jBossAppMetaData) throws DeploymentException
   {
      try
      {
         VirtualFile root = unit.getRoot();
         String libDir = jBossAppMetaData.getLibraryDirectory();
         if (libDir == null || libDir.length() == 0) // take 'lib' even on empty
            libDir = "lib";
         VirtualFile lib = root.getChild(libDir);
         if (lib != null)
         {
            ResourceFilter recurseFilter = new UrlExcludeResourceFilter(lib.toURL());
            unit.addAttachment(ResourceFilter.class.getName() + ".recurse", recurseFilter, ResourceFilter.class);
            log.debug("Excluding ear's lib directory: " + lib);
         }
      }
      catch (Exception e)
View Full Code Here

Examples of org.jboss.virtual.VirtualFile

      JarUtils.addJarSuffix(".vdb"); //$NON-NLS-1$
  
  
  @Override
  public boolean determineStructure(StructureContext structureContext) throws DeploymentException {
    VirtualFile file = structureContext.getFile();
    try {
      if (isLeaf(file) == false) {
        if (file.getName().endsWith(".vdb")) { //$NON-NLS-1$
         
          VirtualFile metainf = file.getChild("META-INF"); //$NON-NLS-1$
          if (metainf == null) {
            return false;
          }
         
          if (metainf.getChild(VdbConstants.DEPLOYMENT_FILE) == null) {
            return false;
          }
         
          List<String> scanDirs = new ArrayList<String>();
          scanDirs.add("/"); //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.virtual.VirtualFile

      if (f.endsWith(path)) {
        path = f;
        break;
      }
    }
    VirtualFile file =this.files.get(path);
    if (file == null) {
      throw new IOException(RuntimePlugin.Util.getString("udf_model_not_found", name)); //$NON-NLS-1$
    }
    List<FunctionMethod> udfMethods = FunctionMetadataReader.loadFunctionMethods(file.openStream());
    ActivityReport<ReportItem> report = new ActivityReport<ReportItem>("UDF load"); //$NON-NLS-1$
    FunctionMetadataValidator.validateFunctionMethods(udfMethods,report);
    if(report.hasItems()) {
        throw new QueryMetadataException(QueryPlugin.Util.getString("ERR.015.001.0005", report)); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.jboss.virtual.VirtualFile

      }
     
      logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
          du.getRelativePath());
     
      VirtualFile root=((VFSDeploymentUnit)du).getRoot();
     
      logger.debug("Deployment descriptor file="+root);

      try {
        VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
       
        logger.debug("Deployment unit dir="+parent);
     
        VirtualFile tmp=VFSUtils.explode(parent);
       
        java.net.URL url=VFSUtils.getCompatibleURL(tmp);
       
        logger.debug("Deployment exploded to dir="+tmp+" URL="+url);
View Full Code Here

Examples of org.jboss.virtual.VirtualFile

   */
  public IndexMetadataFactory(URL url) throws IOException, URISyntaxException {
    VFS.init();
    ZipEntryContext context = new ZipEntryContext(url);
    VirtualFileHandler vfh = context.getRoot();
    VirtualFile vdb = new VirtualFile(vfh);
    List<VirtualFile> children = vdb.getChildrenRecursively(new VirtualFileFilter() {
      @Override
      public boolean accepts(VirtualFile file) {
        return file.getName().endsWith(IndexConstants.NAME_DELIM_CHAR+IndexConstants.INDEX_EXT);
      }
    });
View Full Code Here

Examples of org.jboss.virtual.VirtualFile

    /**
     * @see org.teiid.query.metadata.BasicQueryMetadata#getBinaryVDBResource(java.lang.String)
     * @since 4.3
     */
    public byte[] getBinaryVDBResource(String resourcePath) throws TeiidComponentException, QueryMetadataException {
      final VirtualFile f = getFile(resourcePath);
      if (f == null) {
        return null;
      }
    try {
      return ObjectConverterUtil.convertToByteArray(f.openStream());
    } catch (IOException e) {
      throw new TeiidComponentException(e);
    }
    }
View Full Code Here

Examples of org.jboss.virtual.VirtualFile

      throw new TeiidComponentException(e);
    }
    }
   
    public ClobImpl getVDBResourceAsClob(String resourcePath) {
      final VirtualFile f = getFile(resourcePath);
      if (f == null) {
        return null;
      }
    return new ClobImpl(new VirtualFileInputStreamFactory(f), -1);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.