Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleClassifier holds files open #477

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments
Closed

SimpleClassifier holds files open #477

GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Peter Kelley reported this issue through the mailinglist on 2013-03-09:

I'm having some issues with SimpleClassifier holding files open after it 
completes which is messing up my file processing pipeline. I think that the 
offending method is ClassifyUtils.getContent() which has the following source:

/**
 * INTERNAL: 
 */
public class ClassifyUtils {

  public static byte[] getContent(String file_or_url) {
    File file = new File(file_or_url);
    if (file.exists()) {
      try {
        return StreamUtils.read(new FileInputStream(file));
      } catch (IOException e) {
        // ignore
      }
    }
    // try file_or_url as URL
    return null;
  }


Note that the file is never closed. Would it be possible to amend this method 
to close the file after it has finished? 

Original issue reported on code.google.com by p.kruijsen on 12 Jul 2013 at 8:01

@GoogleCodeExporter
Copy link
Author

Fixed by revision r2403

Original comment by p.kruijsen on 12 Jul 2013 at 8:12

  • Changed state: Fixed
  • Added labels: Release5.2.3

@GoogleCodeExporter
Copy link
Author

Original comment by qsieb...@gmail.com on 1 Aug 2013 at 12:05

  • Added labels: Release5.3.0
  • Removed labels: Release5.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant