Package java.io

Examples of java.io.File.toPath()


        }

        // Copy the WAR file
        File war = new File(host.getAppBaseFile(),
                APP_NAME.getBaseName() + ".war");
        Files.copy(WAR_XML_SOURCE.toPath(), war.toPath());

        // Deploy the copied war
        tomcat.start();
        host.backgroundProcess();
View Full Code Here


                            novo.getParentFile().mkdirs();
                        }
                        if (novo.exists() && jRadioButtonIgnorar.isSelected()) {
                            continue;
                        }
                        Files.copy(original.toPath(), novo.toPath(), StandardCopyOption.COPY_ATTRIBUTES,
                                StandardCopyOption.REPLACE_EXISTING);
                    } catch (IOException ex) {
                        if (mostrarMensagemErro(ex, i, musica)) {
                            return;
                        }
View Full Code Here

                            novo.getParentFile().mkdirs();
                        }
                        if (novo.exists() && jRadioButtonIgnorar.isSelected()) {
                            continue;
                        }
                        Files.copy(original.toPath(), novo.toPath(), StandardCopyOption.COPY_ATTRIBUTES,
                                StandardCopyOption.REPLACE_EXISTING);
                    } catch (IOException ex) {
                        if (mostrarMensagemErro(ex, i, musica)) {
                            return;
                        }
View Full Code Here

                        File novo = new File(pastaDestino.getAbsolutePath(), original.getName());
                        if (novo.exists() && jRadioButtonIgnorar.isSelected()) {
                            continue;
                        }
                        Files.copy(original.toPath(), novo.toPath(), StandardCopyOption.COPY_ATTRIBUTES,
                                StandardCopyOption.REPLACE_EXISTING);
                    } catch (IOException ex) {
                        if (mostrarMensagemErro(ex, i, musica)) {
                            return;
                        }
View Full Code Here

        @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

        {
            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

                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

            }
            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

        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

        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

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.