Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.guvnor.structure.backend.repositories;
 
 import java.net.URI;
 import java.util.List;
 
import  org.guvnor.structure.repositories.RepositoryService;
import  org.guvnor.structure.repositories.RepositoryServiceEditor;
import  org.uberfire.backend.vfs.Path;
import  org.uberfire.io.IOService;
import  org.uberfire.java.nio.base.options.CommentedOption;
import  org.uberfire.java.nio.base.version.VersionRecord;
import  org.uberfire.rpc.SessionInfo;
import static org.uberfire.backend.server.util.Paths.*;
import static org.uberfire.java.nio.file.StandardCopyOption.*;
public class RepositoryServiceEditorImpl implements RepositoryServiceEditor {
    @Inject
    @Named("ioStrategy")
    private IOService ioService;
    @Inject
    private RepositoryService repositoryService;
    @Inject
    private SessionInfo sessionInfo;
    @Override
    public List<VersionRecord> revertHistoryfinal String alias,
                                              final Path path,
                                              final String _comment,
                                              final VersionRecord record ) {
        final org.uberfire.java.nio.file.Path history = .get( URI.createrecord.uri() ) );
        final String comment;
        if ( _comment == null || _comment.trim().isEmpty() ) {
            comment = "revert history from commit {" + record.comment() + "}";
        } else {
            comment = _comment;
        }
        .move( history, convert( path ), REPLACE_EXISTING, new CommentedOption( .getId(), .getIdentity().getIdentifier(), nullcomment ) );
        return new ArrayList<VersionRecord>( .getRepositoryInfo( alias ).getInitialVersionList() );
    }
New to GrepCode? Check out our FAQ X