Package org.uberfire.java.nio.file

Examples of org.uberfire.java.nio.file.Path


            assertNotNull(modelerService);
            assertNotNull(projectService);

            URI projectUri = new URI("default://master@uf-playground/GuvnorM2RepoDependencyExample2");

            Path projectPath = ioService.get(projectUri);
            assertNotNull(projectPath);

            org.uberfire.backend.vfs.Path path = paths.convert(projectPath);
            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
View Full Code Here


            assertNotNull(modelerService);
            assertNotNull(projectService);

            URI projectUri = new URI("default://master@uf-playground/GuvnorM2RepoDependencyExample2");

            Path projectPath = ioService.get(projectUri);
            assertNotNull(projectPath);

            org.uberfire.backend.vfs.Path path = paths.convert(projectPath);
            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
View Full Code Here

public class IndexDecisionTableXLSMultipleTypesTest extends BaseIndexingTest<DecisionTableXLSResourceTypeDefinition> {

    @Test
    public void testIndexDecisionTableXLSMultipleTypes() throws IOException, InterruptedException {
        //Don't ask, but we need to write a single file first in order for indexing to work
        final Path basePath = getDirectoryPath().resolveSibling( "someNewOtherPath" );
        ioService().write( basePath.resolve( "dummy" ),
                           "<none>" );

        //Add test files
        final Path path1 = loadXLSFile( basePath,
                                        "dtable1.xls" );
        final Path path2 = loadXLSFile( basePath,
                                        "dtable2.xls" );

        Thread.sleep( 5000 ); //wait for events to be consumed from jgit -> (notify changes -> watcher -> index) -> lucene index

        final Index index = getConfig().getIndexManager().get( org.uberfire.metadata.io.KObjectUtil.toKCluster( basePath.getFileSystem() ) );
View Full Code Here

        return this.getClass().getSimpleName();
    }

    private Path loadXLSFile( final Path basePath,
                              final String fileName ) throws IOException {
        final Path path = basePath.resolve( fileName );
        final InputStream is = this.getClass().getResourceAsStream( fileName );
        final OutputStream os = ioService().newOutputStream( path );
        IOUtils.copy( is,
                      os );
        os.flush();
View Full Code Here

        final List<ValidationMessage> nonKieResourceValidatorRemovedMessages = new ArrayList<ValidationMessage>();

        for ( final Map.Entry<org.uberfire.backend.vfs.Path, Collection<ResourceChange>> pathCollectionEntry : changes.entrySet() ) {
            for ( final ResourceChange change : pathCollectionEntry.getValue() ) {
                final ResourceChangeType type = change.getType();
                final Path resource = Paths.convert( pathCollectionEntry.getKey() );

                checkNotNull( "type", type );
                checkNotNull( "resource", resource );

                final String destinationPath = resource.toUri().toString().substring( projectPrefix.length() + 1 );
                changedFilesKieBuilderPaths.add( destinationPath );
                switch ( type ) {
                    case ADD:
                    case UPDATE:
                        //Only files can be processed
View Full Code Here

        }
        return false;
    }

    private void fireDeleteEvent( final org.uberfire.backend.vfs.Path _path ) {
        final Path path = ioService.get( URI.create( _path.toURI() ) );
        final Project project = projectService.simpleProjectInstance( path.getParent() );
        deleteProjectEvent.fire( new DeleteProjectEvent( project ) );
    }
View Full Code Here

    }

    @Override
    public List<InboxEntry> readEntries( String userName,
                                         String boxName ) {
        Path path = userServicesBackend.buildPath( userName, INBOX, boxName );

        if ( ioService.exists( path ) ) {
            final String xml = ioService.readAllString( path );
            if ( !( xml == null || xml.equals( "" ) ) ) {
                return (List<InboxEntry>) getXStream().fromXML( xml );
View Full Code Here

    }

    private void writeEntries( final String userName,
                               final String boxName,
                               final List<InboxEntry> entries ) {
        final Path path = userServicesBackend.buildPath( userName, INBOX, boxName );

        String entry = getXStream().toXML( entries );

        ioService.write( path, entry );
    }
View Full Code Here

public class IndexRuleTypeTest extends BaseIndexingTest<GuidedRuleDRLResourceTypeDefinition> {

    @Test
    public void testIndexRuleTypes() throws IOException, InterruptedException {
        //Don't ask, but we need to write a single file first in order for indexing to work
        final Path basePath = getDirectoryPath().resolveSibling( "someNewOtherPath" );
        ioService().write( basePath.resolve( "dummy" ),
                           "<none>" );

        //Add test files
        final Path path1 = basePath.resolve( "drl1.rdrl" );
        final String drl1 = loadText( "drl1.rdrl" );
        ioService().write( path1,
                           drl1 );
        final Path path2 = basePath.resolve( "drl2.rdrl" );
        final String drl2 = loadText( "drl2.rdrl" );
        ioService().write( path2,
                           drl2 );

        Thread.sleep( 5000 ); //wait for events to be consumed from jgit -> (notify changes -> watcher -> index) -> lucene index
View Full Code Here

public class IndexRuleAttributeNameAndValueCompositionTest extends BaseIndexingTest<GuidedRuleDRLResourceTypeDefinition> {

    @Test
    public void testIndexDrlRuleAttributeNameAndValues() throws IOException, InterruptedException {
        //Don't ask, but we need to write a single file first in order for indexing to work
        final Path basePath = getDirectoryPath().resolveSibling( "someNewOtherPath" );
        ioService().write( basePath.resolve( "dummy" ),
                           "<none>" );

        //Add test files
        final Path path = basePath.resolve( "drl1.rdrl" );
        final String drl = loadText( "drl1.rdrl" );
        ioService().write( path,
                           drl );

        Thread.sleep( 5000 ); //wait for events to be consumed from jgit -> (notify changes -> watcher -> index) -> lucene index
View Full Code Here

TOP

Related Classes of org.uberfire.java.nio.file.Path

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.