@@ -336,15 +336,9 @@ static public boolean isLinux() {
336336 @ Deprecated
337337 static public File getContentFile (String name ) {
338338 if (processingRoot == null ) {
339- var url = Platform .class .getClassLoader ().getResource ("lib/defaults.txt" );
340- if (url != null ){
341- try {
342- processingRoot = Files .createTempDirectory ("processing" ).toFile ();
343- copyFromJar ("/" , processingRoot .toPath ());
344- return new File (processingRoot , name );
345- } catch (IOException | URISyntaxException e ) {
346- e .printStackTrace ();
347- }
339+ var resourcesDir = new File (System .getProperty ("compose.application.resources.dir" ));
340+ if (resourcesDir .exists ()) {
341+ return new File (resourcesDir , name );
348342 }
349343 // Get the path to the .jar file that contains Base.class
350344 URL pathURL =
@@ -394,36 +388,6 @@ static public File getContentFile(String name) {
394388 return new File (processingRoot , name );
395389 }
396390
397- public static void copyFromJar (String source , final Path target ) throws URISyntaxException , IOException {
398- var resource = Platform .class .getResource ("" ).toURI ();
399- var fileSystem = FileSystems .newFileSystem (
400- resource ,
401- Collections .<String , String >emptyMap ()
402- );
403-
404-
405- final Path jarPath = fileSystem .getPath (source );
406-
407- Files .walkFileTree (jarPath , new SimpleFileVisitor <Path >() {
408-
409- private Path currentTarget ;
410-
411- @ Override
412- public FileVisitResult preVisitDirectory (Path dir , BasicFileAttributes attrs ) throws IOException {
413- currentTarget = target .resolve (jarPath .relativize (dir ).toString ());
414- Files .createDirectories (currentTarget );
415- return FileVisitResult .CONTINUE ;
416- }
417-
418- @ Override
419- public FileVisitResult visitFile (Path file , BasicFileAttributes attrs ) throws IOException {
420- Files .copy (file , target .resolve (jarPath .relativize (file ).toString ()), StandardCopyOption .REPLACE_EXISTING );
421- return FileVisitResult .CONTINUE ;
422- }
423-
424- });
425- }
426-
427391 static public File getJavaHome () {
428392 var resourcesDir = new File (System .getProperty ("compose.application.resources.dir" ));
429393 if (resourcesDir .exists ()) {
0 commit comments