Examples of toPath()


Examples of java.io.File.toPath()

        @Override
        protected void doGet( HttpServletRequest req, HttpServletResponse resp )
            throws ServletException, IOException
        {
            File jar = new File( System.getProperty( "basedir" ), "src/test/junit-4.9.jar" );
            Files.copy( jar.toPath(), resp.getOutputStream() );

        }
    }

View Full Code Here

Examples of java.io.File.toPath()

        {
            try
            {
                log.info( "index update retrieve file, name:{}", name );
                File file = new File( tempIndexDirectory, name );
                Files.deleteIfExists( file.toPath() );
                file.deleteOnExit();
                wagon.get( addParameters( name, this.remoteRepository ), file );
                return Files.newInputStream( file.toPath() );
            }
            catch ( AuthorizationException | TransferFailedException e )
View Full Code Here

Examples of java.io.File.toPath()

                log.info( "index update retrieve file, name:{}", name );
                File file = new File( tempIndexDirectory, name );
                Files.deleteIfExists( file.toPath() );
                file.deleteOnExit();
                wagon.get( addParameters( name, this.remoteRepository ), file );
                return Files.newInputStream( file.toPath() );
            }
            catch ( AuthorizationException | TransferFailedException e )
            {
                throw new IOException( e.getMessage(), e );
            }
View Full Code Here

Examples of java.io.File.toPath()

            }
            File metaInf = new File(file, "META-INF");
            if (!metaInf.isDirectory()) {
                return;
            }
            Files.walkFileTree(metaInf.toPath(), new SimpleFileVisitor<Path>() {
                @Override
                public FileVisitResult visitFile(Path file,
                                                 BasicFileAttributes attrs)
                        throws IOException {
                    if (!file.endsWith(TLD_EXT)) {
View Full Code Here

Examples of java.io.File.toPath()

        try
        {
            // MavenXpp3Reader leaves the file open, so we need to close it ourselves.

            Model model = null;
            try (Reader reader = Files.newBufferedReader( pom.toPath(), Charset.defaultCharset() ))
            {
                model = MAVEN_XPP_3_READER.read( reader );
            }

            DistributionManagement dist = model.getDistributionManagement();
View Full Code Here

Examples of java.io.File.toPath()

        Configuration configuration = new Configuration();
        NetworkProxyConfiguration proxy = new NetworkProxyConfiguration();
        proxy.setHost( "original-host" );
        configuration.addNetworkProxy( proxy ); // overwritten

        loader.load( Files.newInputStream(confFile.toPath()), configuration );

        Map<String, ManagedRepositoryConfiguration> repositoryIdMap = configuration.getManagedRepositoriesAsMap();
        assertEquals( "Count repositories", 1, repositoryIdMap.size() );
        assertRepositoryExists( "maven-proxy", "target", repositoryIdMap.get( "maven-proxy" ) );
View Full Code Here

Examples of org.apache.archiva.repository.ManagedRepositoryContent.toPath()

        {

            ManagedRepositoryContent sourceRepository =
                repositoryFactory.getManagedRepositoryContent( artifactTransferRequest.getRepositoryId() );

            String artifactSourcePath = sourceRepository.toPath( artifactReference );

            if ( StringUtils.isEmpty( artifactSourcePath ) )
            {
                log.error( "cannot find artifact " + artifactTransferRequest.toString() );
                throw new ArchivaRestServiceException( "cannot find artifact " + artifactTransferRequest.toString() );
View Full Code Here

Examples of org.apache.archiva.repository.ManagedRepositoryContent.toPath()

            }

            ManagedRepositoryContent targetRepository =
                repositoryFactory.getManagedRepositoryContent( artifactTransferRequest.getTargetRepositoryId() );

            String artifactPath = targetRepository.toPath( artifactReference );

            int lastIndex = artifactPath.lastIndexOf( '/' );

            String path = artifactPath.substring( 0, lastIndex );
            File targetPath = new File( target.getLocation(), path );
View Full Code Here

Examples of org.apache.archiva.repository.ManagedRepositoryContent.toPath()

            artifactReference.setClassifier( classifier );
            artifactReference.setType( packaging );

            ManagedRepositoryContent repository = repositoryFactory.getManagedRepositoryContent( repositoryId );

            String artifactPath = repository.toPath( artifactReference );

            int lastIndex = artifactPath.lastIndexOf( '/' );

            String path = artifactPath.substring( 0, lastIndex );
            File targetPath = new File( repoConfig.getLocation(), path );
View Full Code Here

Examples of org.apache.archiva.repository.ManagedRepositoryContent.toPath()

            ArtifactReference ref = new ArtifactReference();
            ref.setArtifactId( artifact.getProject() );
            ref.setGroupId( artifact.getNamespace() );
            ref.setVersion( artifact.getVersion() );
            path = repo.toPath( ref );
            path = path.substring( 0, path.lastIndexOf( "/" ) + 1 ) + artifact.getId();

            // TODO: need to accommodate Maven 1 layout too. Non-maven repository formats will need to generate this
            // facet (perhaps on the fly) if wanting to display the Maven 2 elements on the Archiva pages
            String type = null;
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.