Examples of SVNDirEntry


Examples of org.tmatesoft.svn.core.SVNDirEntry

                        }
                    }
                    if (properties != null) {
                        // Load the properties for this directory ......
                        addProperty(properties, factory, JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FOLDER);
                        SVNDirEntry entry = getEntryInfo(workspaceRoot, directoryPath);
                        if (entry != null) {
                            addProperty(properties, factory, JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate()));
                        }
                    }
                } else {
                    // It's not a directory, so must be a file; the only child of an nt:file is the "jcr:content" node
                    // ...
                    if (requestedPath.endsWith(JcrLexicon.CONTENT)) {
                        // There are never any children of these nodes, just properties ...
                        if (properties != null) {
                            String contentPath = getPathAsString(requestedPath.getParent());
                            if (!accessData.getRepositoryRootUrl().equals(workspaceName)) {
                                contentPath = contentPath.substring(1);
                            }
                            SVNDirEntry entry = getEntryInfo(workspaceRoot, contentPath);
                            if (entry != null) {
                                // The request is to get properties of the "jcr:content" child node ...
                                // Do NOT use "nt:resource", since it extends "mix:referenceable". The JCR spec
                                // does not require that "jcr:content" is of type "nt:resource", but rather just
                                // suggests it. Therefore, we can use "dna:resource", which is identical to
                                // "nt:resource" except it does not extend "mix:referenceable"
                                addProperty(properties, factory, JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE);
                                addProperty(properties, factory, JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate()));
                            }

                            ByteArrayOutputStream os = new ByteArrayOutputStream();
                            SVNProperties fileProperties = new SVNProperties();
                            getData(contentPath, fileProperties, os);
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

     * @return - the {@link SVNDirEntry}, or null if there is no such entry
     */
    protected SVNDirEntry getEntryInfo( SVNRepository repos,
                                        String path ) {
        assert path != null;
        SVNDirEntry entry = null;
        try {
            entry = repos.info(path, -1);
        } catch (SVNException e) {
            throw new RepositorySourceException(
                                                getSourceName(),
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

              SVNLogEntryPath entryPath = ( SVNLogEntryPath ) map.get( it2.next() );             
             
              switch (entryPath.getType()) {
                 
                  case SVNLogEntryPath.TYPE_ADDED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      if ( entryPath.getCopyPath() == null ) {
                          // this entry was added
                          Add add = new Add( type, entryPath.getPath(), logEntry.getRevision());
                          scmLogEntry.addAction( add );
                          break;
                      } else {
                          // this entry was copied
                          Copy copy = new Copy( type, entryPath.getCopyPath(), entryPath.getCopyRevision(), entryPath.getPath(), logEntry.getRevision() );
                          scmLogEntry.addAction( copy );
                          break;                
                      }                     
                  }
                     
                  case SVNLogEntryPath.TYPE_DELETED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Delete delete = new Delete( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( delete );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_MODIFIED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Update update = new Update( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( update );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_REPLACED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Replaced replaced = new Replaced( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( replaced );
                      break;
                  }                                      
              }                           
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

                                                     -1,
                                                     null,
                                                     (Collection) null );
        Iterator iterator = entries.iterator();
        while ( iterator.hasNext() ) {
            SVNDirEntry svnEntry = (SVNDirEntry) iterator.next();

            DefaultScmEntry scmEntry = new DefaultScmEntry();
            scmEntry.setPath( path.equals( "" ) ? path : path.substring( 1 ) );
            scmEntry.setName( svnEntry.getName() );
            scmEntry.setAuthor( svnEntry.getAuthor() );
            scmEntry.setDate( svnEntry.getDate() );
            scmEntry.setRevision( svnEntry.getRevision() );
            scmEntry.setSize( svnEntry.getSize() );
            scmEntry.setType( (svnEntry.getKind() == SVNNodeKind.DIR) ? ScmEntry.DIRECTORY : ScmEntry.FILE );
            list.add( scmEntry );

            if ( svnEntry.getKind() == SVNNodeKind.DIR ) {
                listEntries( path + "/" + svnEntry.getName(),
                             list );
            }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

    public static void listEntries( SVNRepository workspace,
                                    String path ) throws SVNException {
        Collection<SVNDirEntry> entries = workspace.getDir(path, -1, null, (Collection)null);
        Iterator<SVNDirEntry> iterator = entries.iterator();
        while (iterator.hasNext()) {
            SVNDirEntry entry = iterator.next();
            System.out.println("/" + (path.equals("") ? "" : path + "/") + entry.getName() + " ( author: '" + entry.getAuthor()
                               + "'; revision: " + entry.getRevision() + "; date: " + entry.getDate() + ")");
            if (entry.getKind() == SVNNodeKind.DIR) {
                listEntries(workspace, (path.equals("")) ? entry.getName() : path + "/" + entry.getName());
            }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

              SVNLogEntryPath entryPath = ( SVNLogEntryPath ) map.get( it2.next() );             
             
              switch (entryPath.getType()) {
                 
                  case SVNLogEntryPath.TYPE_ADDED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      if ( entryPath.getCopyPath() == null ) {
                          // this entry was added
                          Add add = new Add( type, entryPath.getPath(), logEntry.getRevision());
                          scmLogEntry.addAction( add );
                          break;
                      } else {
                          // this entry was copied
                          Copy copy = new Copy( type, entryPath.getCopyPath(), entryPath.getCopyRevision(), entryPath.getPath(), logEntry.getRevision() );
                          scmLogEntry.addAction( copy );
                          break;                
                      }                     
                  }
                     
                  case SVNLogEntryPath.TYPE_DELETED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Delete delete = new Delete( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( delete );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_MODIFIED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Update update = new Update( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( update );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_REPLACED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Replaced replaced = new Replaced( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( replaced );
                      break;
                  }                                      
              }                           
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

                                                     -1,
                                                     null,
                                                     (Collection) null );
        Iterator iterator = entries.iterator();
        while ( iterator.hasNext() ) {
            SVNDirEntry svnEntry = (SVNDirEntry) iterator.next();

            DefaultScmEntry scmEntry = new DefaultScmEntry();
            scmEntry.setPath( path.equals( "" ) ? path : path.substring( 1 ) );
            scmEntry.setName( svnEntry.getName() );
            scmEntry.setAuthor( svnEntry.getAuthor() );
            scmEntry.setDate( svnEntry.getDate() );
            scmEntry.setRevision( svnEntry.getRevision() );
            scmEntry.setSize( svnEntry.getSize() );
            scmEntry.setType( (svnEntry.getKind() == SVNNodeKind.DIR) ? ScmEntry.DIRECTORY : ScmEntry.FILE );
            list.add( scmEntry );

            if ( svnEntry.getKind() == SVNNodeKind.DIR ) {
                listEntries( path + "/" + svnEntry.getName(),
                             list );
            }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

     */
    Collection entries = repository.getDir(path, -1, null,
        (Collection) null);
    Iterator iterator = entries.iterator();
    while (iterator.hasNext()) {
      SVNDirEntry entry = (SVNDirEntry) iterator.next();
      System.out.println("/" + (path.equals("") ? "" : path + "/")
          + entry.getName() + " (author:" + entry.getAuthor()
          + "; revision:" + entry.getRevision() + ")");
      /*
       * Checking up if the entry is a directory.
       */
      if (entry.getKind() == SVNNodeKind.DIR) {
        listEntries(repository, (path.equals("")) ? entry.getName()
            : path + "/" + entry.getName());
      }
    }
  }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

         */
        Collection entries = repository.getDir(path, -1, null,
                (Collection) null);
        Iterator iterator = entries.iterator();
        while (iterator.hasNext()) {
            SVNDirEntry entry = (SVNDirEntry) iterator.next();
            System.out.println("/" + (path.equals("") ? "" : path + "/")
                    + entry.getName() + " (author: '" + entry.getAuthor()
                    + "'; revision: " + entry.getRevision() + "; date: " + entry.getDate() + ")");
            /*
             * Checking up if the entry is a directory.
             */
            if (entry.getKind() == SVNNodeKind.DIR) {
                listEntries(repository, (path.equals("")) ? entry.getName()
                        : path + "/" + entry.getName());
            }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNDirEntry

                    long size = SVNReader.getLong(direntProps, 2);
                    boolean hasProps = SVNReader.getBoolean(direntProps, 3);
                    long createdRevision = SVNReader.getLong(direntProps, 4);
                    Date createdDate = SVNDate.parseDate(SVNReader.getString(direntProps, 5));
                    String lastAuthor = SVNReader.getString(direntProps, 6);
                    handler.handleDirEntry(new SVNDirEntry(url.appendPath(name, false), repositoryRoot, name, kind, size, hasProps, createdRevision, createdDate, lastAuthor));
                }
            }
        } catch (SVNException e) {
            closeSession();
            throw e;
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.