Note that there are some explanatory texts on larger screens.

plurals
  1. PORecursive method works while debugging, but get's stuck when running from a JAR
    primarykey
    data
    text
    <p>I have the following methods for recursively retrieving images from a folder:</p> <pre><code>private Collection&lt;Image&gt; GetImages(File file) { Collection&lt;Image&gt; result = new LinkedList&lt;Image&gt;(); if (file.isFile()) { result.add(new Image(file)); return result; } for (File f : file.listFiles(new DirAndImagesFilter())) { if (f.isDirectory()) { { result.addAll(GetImages(f)); } } else { result.add(new Image(f)); } } return result; } </code></pre> <p>and here is DirAndImageFilter code:</p> <pre><code>public class DirAndImagesFilter implements FileFilter { private final static String jpeg = "jpeg"; private final static String jpg = "jpg"; private final static String gif = "gif"; private final static String tiff = "tiff"; private final static String tif = "tif"; private final static String png = "png"; public boolean accept(File file) { if (file.isDirectory()) { return true; } String extension = getExtension(file); if (extension != null) { if (extension.equals(tiff) || extension.equals(tif) || extension.equals(gif) || extension.equals(jpeg) || extension.equals(jpg) || extension.equals(png)) { return true; } else { return false; } } return false; } /* * Get the extension of a file. */ static String getExtension(File f) { String ext = null; String s = f.getName(); int i = s.lastIndexOf('.'); if (i &gt; 0 &amp;&amp; i &lt; s.length() - 1) { ext = s.substring(i + 1).toLowerCase(); } return ext; } </code></pre> <p>}</p> <p>When I am running my application from Netbeans it works fine, but when I run JAR file (which is also generated by Netbeans). My application gets stuck in this method.</p> <p>To my understanding JAR file should behave absolutely the same way as the application running in Netbeans. Or am I missing something here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload