Package org.jboss.vfs

Examples of org.jboss.vfs.VirtualFile


      {
         // Use the first root that can accept children
         for (RepositoryRootMetadata rmd : roots)
         {
           
            VirtualFile vf = vfCache.get(rmd.getName());
            if (isDirectory(vf))
            {
               rootName = rmd.getName();
               break;              
            }
View Full Code Here


      return result;
   }

   public VirtualFile getVirtualFileForItem(RepositoryItemMetadata item) throws IOException
   {
      VirtualFile vf = vfCache.get(item.getRootName());
      VirtualFile parent = null;
      List<String> path = item.getRelativePathElements();
      for (String element : path)
      {
         parent = vf;
         vf = parent.getChild(element);
         if (vf == null)
         {
            throw new IllegalStateException("No child " + element + " under " + parent);
         }
      }
View Full Code Here

  
   private static List<String> getRelativePath(VirtualFile file, VirtualFile root)
      throws IOException
   {
      List<String> reversed = new ArrayList<String>();
      VirtualFile now = file;
      while(now != null && now.equals(root) == false)
      {
         reversed.add(now.getName());
         now = now.getParent();
      }
     
      if (now == null)
      {
         throw new IllegalArgumentException(file + " is not a child of " + root);
View Full Code Here

         clusteringHandler.synchronizeContent(true);
        
         // Load applications
         for(URI uri : getRepositoryURIs())
         {
            VirtualFile root = getCachedVirtualFile(uri);
            loadApplications(root);
         }
        
         updateLastModfied();
        
View Full Code Here

      {     
         RepositoryContentMetadata existingRCMD = new RepositoryContentMetadata(this.localContentManager.getOfficialContentMetadata());        
         RepositoryItemMetadata newRIMD = this.clusteringHandler.addDeploymentContent(vfsPath, contentIS);
         RepositoryRootMetadata existingRRMD = existingRCMD.getRepositoryRootMetadata(newRIMD.getRootName());
         boolean exists = existingRRMD != null && existingRRMD.getItemMetadata(newRIMD.getRelativePathElements()) != null;
         VirtualFile root = getCachedVirtualFile(namedURIMap.get(newRIMD.getRootName()));
         VirtualFile contentVF = root.getChild(newRIMD.getRelativePath());

         try
         {
            // Add the new virtual file to the cache
            repositoryName = addVirtualFileCache(contentVF);
View Full Code Here

      try
      {
         ProfileDeployment deployment = getDeployment(vfsPath);
         if (deployment != null)
         {
            VirtualFile vf = VFS.getChild(vfsPath);
            for (Map.Entry<String, URI> entry : namedURIMap.entrySet())
            {
               String relativePath = null;
               VirtualFile root = VFS.getChild(entry.getValue());
               try
               {
                  relativePath = vf.getPathNameRelativeTo(root);
               }
               catch (IllegalArgumentException notParent)
View Full Code Here

      Map<String, URI> map = new HashMap<String, URI>();
      if (uris != null)
      {
         for (URI uri : uris)
         {
            VirtualFile vf = getCachedVirtualFile(uri);
            map.put(vf.getName(), uri);
         }
      }
     
      return map;
   }
View Full Code Here

   /** The filter. */
   private static VirtualFileFilter filter = new SuffixMatchFilter(".xml");

   public static boolean hasBeenModified(VFSDeploymentUnit unit, long lastModified) throws Exception
   {
      VirtualFile root = unit.getRoot();
      if (root.isFile())
      {
         if(root.getLastModified() > lastModified)
            return true;
      }

      StructureMetaData structureMetaData = unit.getAttachment(StructureMetaData.class);
      if(structureMetaData == null)
View Full Code Here

      List<MetaDataEntry> metadataPaths = contextInfo.getMetaDataPath();
      if (metadataPaths != null && metadataPaths.isEmpty() == false)
      {
         for (MetaDataEntry metaDataPath : metadataPaths)
         {
            VirtualFile mdpVF = root.getChild(metaDataPath.getPath());
            if (mdpVF.exists())
            {
               List<VirtualFile> children = mdpVF.getChildren(filter);
               if (children != null && children.isEmpty() == false)
               {
                  for (VirtualFile child : children)
                  {
                     if (child.getLastModified() > lastModified)
View Full Code Here

      {
         d = new AbstractDeployment(profileDeployment.getName());
      }
      else
      {
         VirtualFile vf = profileDeployment.getRoot();
         // The ones created using the {@code AutoUnmounter}
         if(profileDeployment instanceof WorkaroundProfileDeployment)
         {
            try
            {
View Full Code Here

TOP

Related Classes of org.jboss.vfs.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.