public Path createTempFile(final String fullFileName) throws IOException { final File file = tempFiles.createTempFile(fullFileName); final Path path = paths.convert(ioService.get(file.toURI())); pathToFile.put(path, file); return path; }
public Path createTempFile(final String fullFileName) throws IOException { final File file = tempFiles.createTempFile(fullFileName); final Path path = paths.convert(fileSystemProvider.getPath(file.toURI())); pathToFile.put(path, file); return path; }
public Path createTempFile(final String fullFileName) throws IOException { final File file = tempFiles.createTempFile(fullFileName); final Path path = paths.convert(fileSystemProvider.getPath(file.toURI())); pathToFile.put(path, file); return path; }
public Path createTempFile(final String fullFileName) throws IOException { final File file = tempFiles.createTempFile(fullFileName); final Path path = paths.convert(ioService.get(file.toURI())); pathToFile.put(path, file); return path; }
public Path createTempFile(final String fullFileName) throws IOException { final File file = tempFiles.createTempFile(fullFileName); final Path path = paths.convert(fileSystemProvider.getPath(file.toURI())); pathToFile.put(path, file); return path; }
public Path createTempFile(final String fullFileName) throws IOException { final File file = tempFiles.createTempFile(fullFileName); final Path path = paths.convert(ioService.get(file.toURI())); pathToFile.put(path, file); return path; }
public TestJarWriter addFile( final String fileName ) throws IOException { File tempFile = tempFiles.createTempFile( fileName ); zipWriter.addFile( new ZipEntry( fileName ), new FileInputStream( tempFile ) ); return this; }
private TestJarWriter getJarWriter( final String artifactName ) throws IOException { final Artifact artifact = mock( Artifact.class ); final File file = tempFiles.createTempFile( artifactName + ".jar" ); when( artifact.getFile() ).thenReturn( file ); when( this.mavenRepository.resolveArtifact( artifactName ) ).thenReturn( artifact ); return new TestJarWriter( file, tempFiles ); }
@Test public void testFiles() throws Exception { final File pomFile = tempFiles.createTempFile("mydir/pom.xml"); final File javaClass = tempFiles.createTempFile("mydir/org/test/Person.java"); assertTrue(pomFile.exists()); assertTrue(javaClass.exists()); tempFiles.deleteFiles(); assertFalse(pomFile.exists()); assertFalse(javaClass.exists()); } }
@Test public void testFiles() throws Exception { final File pomFile = tempFiles.createTempFile("mydir/pom.xml"); final File javaClass = tempFiles.createTempFile("mydir/org/test/Person.java"); assertTrue(pomFile.exists()); assertTrue(javaClass.exists()); tempFiles.deleteFiles(); assertFalse(pomFile.exists()); assertFalse(javaClass.exists()); } }
@Test public void testFiles() throws Exception { final File pomFile = tempFiles.createTempFile("mydir/pom.xml"); final File javaClass = tempFiles.createTempFile("mydir/org/test/Person.java"); assertTrue(pomFile.exists()); assertTrue(javaClass.exists()); tempFiles.deleteFiles(); assertFalse(pomFile.exists()); assertFalse(javaClass.exists()); } }
@Before public void setUp() throws Exception { final SimpleFileSystemProvider fs = new SimpleFileSystemProvider(); // Bootstrap WELD container weld = new Weld(); final BeanManager beanManager = weld.initialize().getBeanManager(); //Instantiate Paths used in tests for Path conversion final Bean pathsBean = ( Bean ) beanManager.getBeans( Paths.class ).iterator().next(); final CreationalContext cc = beanManager.createCreationalContext( pathsBean ); Paths paths = ( Paths ) beanManager.getReference( pathsBean, Paths.class, cc ); //Ensure URLs use the default:// scheme fs.forceAsDefault(); tempFiles = new TempFiles(); final File tempFile = tempFiles.createTempFile( "white-list" ); final org.uberfire.java.nio.file.Path nioPackagePath = fs.getPath( tempFile.toURI() ); pathToWhiteList = paths.convert( nioPackagePath ); loader = new PackageNameWhiteListLoader( packageNameSearchProvider, ioService ); }