Examples of WebdavResource


Examples of org.apache.webdav.lib.WebdavResource

           
            conn1 = (WebDAVConnection) _factory.getConnection(spec);
            out.println("Connection1: " + conn1 + "<br>");
            System.out.println("Connection1: " + conn1);

            WebdavResource wr1 = conn1.getWebdavResource();
            // outside of any transaction:
            HttpURL httpURL = new HttpURL(HOST.toCharArray());
            httpURL.setUserinfo(USER, PASSWORD);

            WebdavResource wr2 = new WebdavResource(httpURL);

            out.println("WR1: " + wr1 + "<br>");
            System.out.println("WR1: " + wr1);
            out.println("WR2: " + wr2 + "<br>");
            System.out.println("WR2: " + wr2);

           
            wr1.putMethod(HOST+"/file1", "Content");
            String thisIsWhatTx1Sees =  wr1.getMethodDataAsString(HOST+"/file1");
            String thisIsWhatTx2Sees = wr2.getMethodDataAsString(HOST+"/file1");

            out.println("WR1 sees " + thisIsWhatTx1Sees + "<br>");
            System.out.println("WR1 sees " + thisIsWhatTx1Sees);
            out.println("WR2 sees this before commit" + thisIsWhatTx2Sees + "<br>");
            System.out.println("WR2 sees this before commit " + thisIsWhatTx2Sees);

            tx.commit();
           
            thisIsWhatTx2Sees = wr2.getMethodDataAsString(HOST+"/file1");
            out.println("WR2 sees this after commit " + thisIsWhatTx2Sees + "<br>");
            System.out.println("WR2 sees this after commit " + thisIsWhatTx2Sees);
           
        } catch (Exception e) {
            if (tx != null)
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

      return listMembers (baseUrl, filter, false);
   }

   public Collection listMembers (URL baseUrl, URLFilter filter, boolean scanNonDottedSubDirs) throws IOException
   {
      WebdavResource resource = null;
      try
      {
         resource = new WebdavResource (baseUrl.toString ());
         WebdavResource[] resources = resource.listWebdavResources ();
         List urls = new ArrayList (resources.length);
         for (int i = 0; i < resources.length; i++)
         {
            WebdavResource member = resources[i];
            HttpURL httpURL = member.getHttpURL ();
            if (filter.accept (baseUrl, httpURL.getName ()))
            {
               String uri = httpURL.getURI();
               if (member.isCollection ())
               {
                  if (! uri.endsWith ("/"))
                     uri += "/";

                  // it is a directory: do we have to recursively list its content?
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

      return listMembers (baseUrl, filter, false);
   }

   public Collection listMembers (URL baseUrl, URLFilter filter, boolean scanNonDottedSubDirs) throws IOException
   {
      WebdavResource resource = null;
      try
      {
         resource = new WebdavResource (baseUrl.toString ());
         WebdavResource[] resources = resource.listWebdavResources ();
         List urls = new ArrayList (resources.length);
         for (int i = 0; i < resources.length; i++)
         {
            WebdavResource member = resources[i];
            HttpURL httpURL = member.getHttpURL ();
            if (filter.accept (baseUrl, httpURL.getName ()))
            {
               String uri = httpURL.getURI();
               if (member.isCollection ())
               {
                  if (! uri.endsWith ("/"))
                     uri += "/";

                  // it is a directory: do we have to recursively list its content?
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

      return listMembers (baseUrl, filter, false);
   }

   public Collection<URL> listMembers (URL baseUrl, URLFilter filter, boolean scanNonDottedSubDirs) throws IOException
   {
      WebdavResource resource = null;
      try
      {
         resource = new WebdavResource (baseUrl.toString ());
         WebdavResource[] resources = resource.listWebdavResources ();
         List<URL> urls = new ArrayList<URL>(resources.length);
         for (int i = 0; i < resources.length; i++)
         {
            WebdavResource member = resources[i];
            HttpURL httpURL = member.getHttpURL ();
            if (filter.accept (baseUrl, httpURL.getName ()))
            {
               String uri = httpURL.getURI();
               if (member.isCollection ())
               {
                  if (! uri.endsWith ("/"))
                     uri += "/";

                  // it is a directory: do we have to recursively list its content?
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

    protected void dumpCollection( WebdavResource webdavResource, String path )
        throws Exception
    {
        webdavResource.setPath( path );
        WebdavResource resources[] = webdavResource.listWebdavResources();

        System.out.println( "Dump Collection [" + path + "]: " + resources.length + " hits." );

        dumpCollectionRecursive( "", webdavResource, path );
    }
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

        if ( indent.length() > 12 )
        {
            return;
        }

        WebdavResource resources[] = webdavResource.listWebdavResources();

        for ( int i = 0; i < resources.length; i++ )
        {
            System.out.println( indent + "WebDavResource[" + path + "|" + i + "]: "
                + ( resources[i].isCollection() ? "(collection) " : "" ) + resources[i].getName() );
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

        {
            webdavResource.setPath( path );

            WebdavResources resources = webdavResource.getChildResources();

            WebdavResource testResource = resources.getResource( filename );

            if ( testResource == null )
            {
                fail( "The file/contents <" + path + "/" + filename + "> does not exist in <" + httpurl + ">" );
            }

            if ( testResource.isCollection() )
            {
                fail( "The file/contents <" + path + "/" + filename
                    + "> is incorrectly being reported as a collection." );
            }
        }
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

        {
            webdavResource.setPath( path );

            WebdavResources resources = webdavResource.getChildResources();

            WebdavResource testResource = resources.getResource( filename );

            if ( testResource == null )
            {
                // Nothing found. we're done.
                return;
            }

            if ( !testResource.isCollection() )
            {
                fail( "Encountered unexpected file/contents <" + path + "/" + filename + "> at <" + httpurl + ">" );
            }
        }
        finally
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

        // Setup Client Side

        HttpURL httpSandboxUrl = new HttpURL( "http://localhost:" + PORT + CONTEXT + "/" );

        davRepo = new WebdavResource( httpSandboxUrl );

        davRepo.setDebug( 8 );

        davRepo.setPath( CONTEXT );
    }
View Full Code Here

Examples of org.apache.webdav.lib.WebdavResource

       
        // Setup Client Side

        HttpURL httpSandboxUrl = new HttpURL( "http://localhost:" + PORT + CONTEXT + "/" );

        davRepo = new WebdavResource( httpSandboxUrl );

        davRepo.setDebug( 8 );

        davRepo.setPath( CONTEXT );
    }
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.