Package org.jboss.virtual

Examples of org.jboss.virtual.VirtualFile


   }

   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
   {
      ContextInfo context = null;
      VirtualFile file = structureContext.getFile();
      try
      {
         boolean trace = log.isTraceEnabled();
         if (isLeaf(file) == true)
         {
            boolean isFile = false;
            if( trace )
               log.trace(file + " is a leaf");
            // See if this is a top-level by checking the parent
            if (structureContext.isTopLevel() == false)
            {
               if (isKnownFile(file.getName()) == false && checkFileMatchers(file) == false)
               {
                  if (trace)
                     log.trace("... no - it is not a top level file and not a known name");
               }
               else
               {
                  if (trace)
                     log.trace("... ok - not a top level file but it is a known name");
                  isFile = true;
               }
            }
            else
            {
               if (trace)
                  log.trace("... ok - it is a top level file");
               isFile = true;
            }

            // Create a context info for this file
            if (isFile)
               context = createContext(structureContext);
            // There are no subdeployments for files
            if (trace)
               log.trace(file + " isFile: " + isFile);
            return isFile;
         }
         else
         {
            if (trace)
               log.trace("... no - not a file.");
            return false;
         }
      }
      catch (Exception e)
      {
         if (context != null)
            structureContext.removeChild(context);

         throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
      }
   }
View Full Code Here


   }

   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
   {
      ContextInfo context = null;
      VirtualFile file = structureContext.getFile();
      try
      {
         boolean trace = log.isTraceEnabled();

         if (isLeaf(file) == false)
         {
            // For non top level directories that don't look like jars
            // we require a META-INF otherwise each subdirectory would be a subdeployment
            if (JarUtils.isArchive(file.getName()) == false)
            {
               if (structureContext.isTopLevel() == false)
               {
                  try
                  {
                     VirtualFile child = file.getChild("META-INF");
                     if (child != null)
                     {
                        if (trace)
                           log.trace("... ok - non top level directory has a META-INF subdirectory");
                     }
View Full Code Here

         {
            if (entry == null)
               throw new IllegalArgumentException("Null entry in paths: " + paths);

            String path = entry.getPath();
            VirtualFile child = root.getChild(path);
            if (child != null)
               locations.put(child, entry.getType());
            else
               log.debug("Meta data path does not exist: root=" + root.getPathName() + " path=" + path);
         }
View Full Code Here

            List<VirtualFile> result = new ArrayList<VirtualFile>(metadataPaths.size());
            for (MetaDataEntry metadataPath : metadataPaths)
            {
               try
               {
                  VirtualFile child = file.getChild(metadataPath.getPath());
                  if (child != null)
                     result.add(child);
               }
               catch (Exception ignored)
               {
View Full Code Here

         List<VirtualFile> result = new ArrayList<VirtualFile>();
         for(Map.Entry<VirtualFile, MetaDataType> entry : metaDataLocations.entrySet())
         {
            if (filter.accepts(entry.getValue()))
            {
               VirtualFile location = entry.getKey();
               result.add(location);
            }
         }
         return result;
      }
View Full Code Here

    * @param filter the metadata type filter
    * @return found file or null if not found
    */
   protected VirtualFile searchMetaDataLocations(String name, MetaDataTypeFilter filter)
   {
      VirtualFile result = null;
      for(Map.Entry<VirtualFile, MetaDataType> entry : metaDataLocations.entrySet())
      {
         if (filter.accepts(entry.getValue()))
         {
            VirtualFile location = entry.getKey();
            try
            {
               result = location.getChild(name);
               if (result != null)
               {
                  if (log.isTraceEnabled())
                     log.trace("Found " + name + " in " + location.getName());
                  deployed();
                  break;
               }
            }
            catch (IOException e)
            {
               log.debug("Search exception invocation for metafile " + name + " in " + location.getName() + ", reason: " + e);
            }
         }
      }
      return result;
   }
View Full Code Here

         List<VirtualFile> results = new ArrayList<VirtualFile>();
         for(Map.Entry<VirtualFile, MetaDataType> entry : metaDataLocations.entrySet())
         {
            if (mdtf.accepts(entry.getValue()))
            {
               VirtualFile location = entry.getKey();
               List<VirtualFile> result = location.getChildren(filter);
               if (result != null && result.isEmpty() == false)
               {
                  if (log.isTraceEnabled())
                     log.trace("Found results with " + filter + " in " + location.getName());
                  results.addAll(result);
                  deployed();
               }
            }
         }
View Full Code Here

         throw new IllegalArgumentException("Null locations");

      Map<VirtualFile, MetaDataType> locationsMap = new LinkedHashMap<VirtualFile, MetaDataType>();
      for (int i = locations.length-1; i >= 0; --i)
      {
         VirtualFile location = locations[i];
         if (location == null)
            throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(locations));
         locationsMap.put(location, MetaDataType.DEFAULT);
      }
View Full Code Here

      if (classPath == null)
         classPath = new ArrayList<VirtualFile>();

      for (int i = files.length-1; i >= 0; --i)
      {
         VirtualFile file = files[i];
         if (file == null)
            throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(files));
         classPath.add(0, file);
      }
      setClassPath(classPath);
View Full Code Here

      if (classPath == null)
         classPath = new ArrayList<VirtualFile>();

      for (int i = files.size()-1; i >= 0; --i)
      {
         VirtualFile file = files.get(i);
         if (file == null)
            throw new IllegalArgumentException("Null virtual file in " + files);
         classPath.add(0, file);
      }
      setClassPath(classPath);
View Full Code Here

TOP

Related Classes of org.jboss.virtual.VirtualFile

Copyright © 2018 www.massapicom. 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.