Package fuse.zipfs.util

Examples of fuse.zipfs.util.Node


      throw new FuseException("Read Only").initErrno(FuseException.EACCES);
   }

   public FuseStat getattr(String path) throws FuseException
   {
      Node node = tree.lookupNode(path);
      ZipEntry entry = null;
      if (node == null || (entry = (ZipEntry)node.getValue()) == null)
         throw new FuseException("No Such Entry").initErrno(FuseException.ENOENT);

      FuseStat stat = new FuseStat();

      stat.mode = entry.isDirectory() ? FuseFtype.TYPE_DIR | 0755 : FuseFtype.TYPE_FILE | 0644;
View Full Code Here


      return stat;
   }

   public FuseDirEnt[] getdir(String path) throws FuseException
   {
      Node node = tree.lookupNode(path);
      ZipEntry entry = null;
      if (node == null || (entry = (ZipEntry)node.getValue()) == null)
         throw new FuseException("No Such Entry").initErrno(FuseException.ENOENT);

      if (!entry.isDirectory())
         throw new FuseException("Not A Directory").initErrno(FuseException.ENOTDIR);

      Collection children = node.getChildren();
      FuseDirEnt[] dirEntries = new FuseDirEnt[children.size()];

      int i = 0;
      for (Iterator iter = children.iterator(); iter.hasNext(); i++)
      {
         Node childNode = (Node)iter.next();
         ZipEntry zipEntry = (ZipEntry)childNode.getValue();
         FuseDirEnt dirEntry = new FuseDirEnt();
         dirEntries[i] = dirEntry;
         dirEntry.name = childNode.getName();
         dirEntry.mode = zipEntry.isDirectory()? FuseFtype.TYPE_DIR : FuseFtype.TYPE_FILE;
      }

      return dirEntries;
   }
View Full Code Here

   //
   // private methods

   private ZipEntry getFileZipEntry(String path) throws FuseException
   {
      Node node = tree.lookupNode(path);
      ZipEntry entry;
      if (node == null || (entry = (ZipEntry)node.getValue()) == null)
         throw new FuseException("No Such Entry").initErrno(FuseException.ENOENT);

      if (entry.isDirectory())
         throw new FuseException("Not A File").initErrno(FuseException.ENOENT);
View Full Code Here

      return entry;
   }

   private ZipEntry getDirectoryZipEntry(String path) throws FuseException
   {
      Node node = tree.lookupNode(path);
      ZipEntry entry;
      if (node == null || (entry = (ZipEntry)node.getValue()) == null)
         throw new FuseException("No Such Entry").initErrno(FuseException.ENOENT);

      if (!entry.isDirectory())
         throw new FuseException("Not A Directory").initErrno(FuseException.ENOENT);
View Full Code Here

TOP

Related Classes of fuse.zipfs.util.Node

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.