Examples of VFSResource


Examples of com.adito.vfs.VFSResource

     * @throws DAVBundleActionMessageException on any VFS or DAV related errors
     * @throws Exception on any other error
     */
    public static VFSResource getDAVResource(LaunchSession launchSession, HttpServletRequest request, HttpServletResponse response,
                                             String path) throws DAVBundleActionMessageException, Exception {
        VFSResource res = null;
        try {
            DAVProcessor processor = getDAVProcessor(request);
            DAVTransaction transaction = new DAVTransaction(request, response);
            res = processor.getRepository().getResource(launchSession, path, transaction.getCredentials());
            // res.start(transaction);
            res.verifyAccess();
        } catch (DAVAuthenticationRequiredException e) {
            DAVServlet.sendAuthorizationError(request, response, e.getHttpRealm());
            throw e;
        }
        return res;
View Full Code Here

Examples of com.adito.vfs.VFSResource

                  out.println("</tr>");
                  out.println("</thead>");
                  out.println("<tbody>");
 
                  /* Process the parent */
                  VFSResource parent = resource.getParent();
                  if (parent != null && (parent.isBrowsable() || !SystemProperties.get("adito.disableFolderBrowsing", "true").equals("true"))) {
                    out.println("<tr>");
                      out.print("<td><li><a href=\"..\">../</a></td>");
                    out.println("<td>Dir</td><td>");
                    try {
                      out.println(parent.getFile().getContent().getSize());
                    }
                    catch(Exception e) {                     
                    }
                    out.println("</td><td>");
                    try {
                      out.println(SimpleDateFormat.getDateTimeInstance().format(new Date(parent.getFile().getContent().getLastModifiedTime())));
                    }
                    catch(Exception e) {                     
                    }
                    out.println("</td></tr>");
                  }
 
                  /* Process the children */
                  Iterator iterator = resource.getChildren();
                  if (iterator != null) {
                      while (iterator.hasNext()) {
                          VFSResource child = (VFSResource) iterator.next();
                          String childPath = child.getDisplayName();

                      out.println("<tr>");
                        out.print("<td><li><a href=\"" + child.getWebFolderPath() + "\">"  + childPath +  "</a></td>");
                        if(child.isCollection())
                          out.println("<td>Dir</td><td>");
                        else if(child.isResource())
                          out.println("<td>Resource</td><td>");
                        else
                          out.println("<td>Unknown</td><td>");
                      try {
                        out.println(child.getFile().getContent().getSize());
                      }
                      catch(Exception e) {                     
                      }
                      out.println("</td><td>");
                      try {
                        out.println(SimpleDateFormat.getDateTimeInstance().format(new Date(child.getFile().getContent().getLastModifiedTime())));
                      }
                      catch(Exception e) {                     
                      }
                      out.println("</td></tr>");
                      out.println("</tr>");
View Full Code Here

Examples of com.adito.vfs.VFSResource

            /* Process this resource's children (if required) */
            if (resource.isCollection() && (depth > 0)) {
                Iterator children = resource.getChildren();
                while (children.hasNext()) {
                    VFSResource child = (VFSResource) children.next();
                    this.process(transaction, out, child);
                }
            }

            /* Close up the XML Multi-Status response */
 
View Full Code Here

Examples of com.adito.vfs.VFSResource

     *
     * @throws IOException
     */
    public void process(DAVTransaction transaction, VFSResource resource) throws LockedException, IOException {
        String handle = VFSLockManager.getNewHandle();
        VFSResource dest = null;
        VFSLockManager.getInstance().lock(resource, transaction.getSessionInfo(), true, true, handle);
       
        try {
            try {
                //super.process(transaction, resource);
View Full Code Here

Examples of com.adito.vfs.VFSResource

           

            /* Get the resource. The launch session may be converted to a tracked session
             * at this point
             */
            VFSResource resource = repository.getResource(launchSession, path, transaction.getCredentials());

            /*
             * This is to verify that we have access. We process the cause of
             * the exception to determine whether an authentication exception
             * should be thrown
             */
            resource.verifyAccess();

            /*
             * Now verify the launch session allows access
             */

 
View Full Code Here

Examples of com.adito.vfs.VFSResource

    /**
     * <p>Merge the details held into the specified {@link DAVException}
     * into this instance.</p>
     */
    public void merge(DAVException exception) {
        VFSResource resource = exception.getResource();
        if (resource == null) throw exception;

        int status = exception.getStatus();
        String message = exception.getMessage();
        this.responses.add(new Response(resource, status, message));
View Full Code Here

Examples of com.adito.vfs.VFSResource

    public VFSResource getResource(String path, PasswordCredentials requestCredentials)
            throws IOException {
      if (path.equalsIgnoreCase("private") || path.equalsIgnoreCase("upgrade")) {
        throw new IOException("Permission denied.");
      }
      VFSResource parent = null;
      if (path.equals("")) {
        parent = getStore().getStoreResource();
      }
      return new FileObjectVFSResource(getLaunchSession(), this,
              parent,
View Full Code Here

Examples of com.adito.vfs.VFSResource

      super(null, SiteStore.this, "icons", false);
    }

    public VFSResource getResource(String path, PasswordCredentials requestCredentials)
            throws IOException {
      VFSResource parent = null;
      if (path.equals("")) {
        parent = getStore().getStoreResource();
      }
      return new FileObjectVFSResource(getLaunchSession(), this,
              parent,
View Full Code Here

Examples of com.adito.vfs.VFSResource

      String handle = VFSLockManager.getNewHandle();
      VFSLockManager.getInstance().lock(resource, transaction.getSessionInfo(), false, true, handle);
  
        String action = (String) transaction.getRequest().getMethod();

        VFSResource dest = null;
       
    try {
         
          URI target = transaction.getDestination();
View Full Code Here

Examples of com.adito.vfs.VFSResource

   *      com.adito.vfs.webdav.DAVTransaction)
   */
  public VFSResource getResource(String path, PasswordCredentials requestCredentials) throws IOException,
          DAVAuthenticationRequiredException {
     
    VFSResource parent = null;
    if(path.equals("")) {
      parent = store.getStoreResource();
    }
    return new NetworkPlaceVFSResource(getLaunchSession(), this,
            parent,
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.