Package org.uberfire.java.nio.file

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


    }

    public String updateAsset(Asset asset, String commitMessage) throws AssetNotFoundException {
        encodeAsset(asset);
        String uniqueId = decodeUniqueId(asset.getUniqueId());
        Path filePath = getFileSystem(uniqueId).provider().getPath(URI.create(uniqueId));
        if(commitMessage == null) {
            commitMessage = "Updated asset ";
        }
        if (!ioService.exists(filePath)) {
            throw new AssetNotFoundException();
View Full Code Here


        }
    }

    public boolean deleteAssetFromPath(String path) {
        path = UriUtils.encode(path);
        Path filePath = descriptor.getFileSystem().provider().getPath(URI.create(descriptor.getStringRepositoryRoot() + path));

        return deleteAsset(filePath.toUri().toString());
    }
View Full Code Here

        if (!assetExists(decodedUniqueId)) {
            throw new IllegalArgumentException("Asset does not exist");
        }
        try {
            FileSystem fileSystem = descriptor.getFileSystem();
            Path sourcePath = fileSystem.provider().getPath(URI.create(decodedUniqueId));
            Path destinationPath = fileSystem.provider().getPath(URI.create(descriptor.getStringRepositoryRoot() + location
                    + fileSystem.getSeparator() + sourcePath.getFileName().toString()));
            createIfNotExists(destinationPath);

            CommentedOption commentedOption = new CommentedOption(getIdentity(), "Copied asset " + sourcePath.getFileName()
                    + " into " + location);
View Full Code Here

        if (!assetExists(decodedUniqueId)) {
            throw new IllegalArgumentException("Asset does not exist");
        }
        try {
            FileSystem fileSystem = descriptor.getFileSystem();
            Path sourcePath = fileSystem.provider().getPath(URI.create(decodedUniqueId));
            if (name == null) {
                name = sourcePath.getFileName().toString();
            }

            Path destinationPath = fileSystem.provider().getPath(URI.create(descriptor.getStringRepositoryRoot() + location + fileSystem.getSeparator() + name));
            createIfNotExists(destinationPath);
            CommentedOption commentedOption = new CommentedOption(getIdentity(), "Moved asset " + sourcePath.getFileName()
                    + " into " + location);
            fileSystem.provider().move(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING, commentedOption);
View Full Code Here

    private RepositoryDescriptor buildAndRegister(Repository repository, String branchName) {
        String repoUri = repository.getRoot().toURI().replaceFirst("://.*?@", "://"+branchName+"@");
        URI root = URI.create(repoUri);

        FileSystem fs = ioService.getFileSystem(root);
        Path rootPath = fs.provider().getPath(root);

        RepositoryDescriptor descriptor = new RepositoryDescriptor(root, fs, rootPath);
        knownRepositories.put(branchName+"@"+repository.getAlias(), descriptor);

        return descriptor;
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

            assertNotNull(paths);

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

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

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, paths.convert(projectPath)));

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(paths.convert(projectPath));
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

            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

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.