Package org.maqetta.server

Examples of org.maqetta.server.IVResource


    }


  protected IVResource getLibFile(String p1) {
    IPath path = new Path(p1);
    IVResource root = this.workspace;
    for (int i = 0; i < path.segmentCount() && root != null; i++) {
      root = root.get(path.segment(i));

    }

    return root;
  }
View Full Code Here


                  return null;
              }
          }
          String[] segments = a.segments();
          IPath me = new Path(this.userDirectory.getAbsolutePath());
          IVResource parent = this.workspace;
          for (int i = me.matchingFirstSegments(a); i < segments.length; i++) {
              int segsToEnd = segments.length - i - 1;
              String s = a.removeLastSegments(segsToEnd).toOSString();
              IStorage f = this.userDirectory.newInstance(s);
              parent = new VFile(f, parent, segments[i]);
View Full Code Here

      path = path.replace('/', File.separatorChar);
      VFile linkFile = new VFile(this.userDirectory.newInstance(path));
      return linkFile;
    }
    */
    IVResource directory = new VFile(this.userDirectory, this.workspace);
    /* make sure the new resoruce is within the user directory */
   
    IVResource userFile = directory.create(path);

    return userFile;
  }
View Full Code Here

    IPath path = new Path(pathStr);
    ArrayList results = new ArrayList();

    // Links links = this.getLinks();
    if (isWildcard) {
      IVResource start = null;
      if (startFolder == null || startFolder.equals(".")) {
              start = this.workspace;
        } else {
             start = this.getResource(startFolder);
        }
     
      results.addAll(Arrays.asList((start.find(pathStr))));
     
     
     
    } else {
      IVResource file = this.getResource(pathStr);
      if (file != null && file.exists()) {
        results.add(file);
      }

    }
    /* search the libraries */
 
View Full Code Here

      //   'path': checked by User.createResource()
      //   'isFolder': validated by Boolean.parseBoolean()

        String path = req.getParameter("path");
        boolean isFolder = Boolean.parseBoolean(req.getParameter("isFolder"));
        IVResource newFile = user.createResource(path,isFolder);
        if (newFile.exists()) {
            responseString = "EXISTS";
        } else if (isFolder) {
            if (newFile.mkdir()) {
                responseString = "OK";
            } else {
              throw new IOException("Failed to create folder. path:" + path);
            }
        } else {
            newFile.createNewInstance();
           
            /* HACK: this fixes a bug that if a user creates a new / empty resource, then closes it the files working copy isn't removed in windows with the file.delete() call.
             * it seems if you open an IO stream to the resource (without writing anything) then close and flush the stream the problem goes away.
             */
            responseString = "OK";
View Full Code Here

    IVResource[] list = source.listFiles();

    for (int i = 0; i < list.length; i++) {
      if(list[i].isVirtual()) continue;
      destination.mkdir();
      IVResource r = destination.create(list[i].getName());
      if (list[i].isDirectory()) {
        r.mkdir();
        if (recurse) {
          VResourceUtils.copyDirectory(list[i], r, recurse);
        }
      } else {
        try {
          if (!r.exists()) {
            r.createNewInstance();
            VResourceUtils.copyFile(list[i], r);
            r.flushWorkingCopy();
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
View Full Code Here

            String path = libEntry.get("root");
            Library lib = ServerManager.getServerManager().getLibraryManager().getLibrary(id, version);
           
            boolean sourceLibrary = lib.getSourcePath() != null && useSource;
           
            IVResource libResource = new VLibraryResource(lib, lib.getURL("", sourceLibrary),path, "",sourceLibrary);
            zipDir(libResource,root, zos, true);
        }
    }
View Full Code Here

TOP

Related Classes of org.maqetta.server.IVResource

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.