Questions tagged [apache-commons-io]

Apache Commons IO is a library of utilities to assist with developing IO functionality.

Apache Commons Commons IO is a library of utilities to assist with developing IO functionality.

There are six main areas included:

  • Utility classes - with static methods to perform common tasks
  • Input - useful Input Stream and Reader implementations
  • Output - useful Output Stream and Writer implementations
  • Filters - various implementations of file filters
  • Comparators - various implementations of java.util.Comparator for files
  • File Monitor - a component for monitoring file system events

Official Website: http://commons.apache.org/io/

Useful Links:

Related Tags:

175 questions
0
votes
0 answers

Error in FileUtils.copyUrlToFile

I am executing the below code to pull the .gz file from a URL to a local directory.For small files it goes through fine but for large files it downloads only part of it but does not fail. I get to know the error only when I try to UNZIP it. Can…
user3072054
  • 319
  • 2
  • 6
  • 17
0
votes
3 answers

Unable to Move File from one location to another location on linux file system using java

I am trying to move files from one location to another location in Linux file system. Actually my source directory is on one file system and destination directory is mounted on to the same file system. So am using File.renameTo() method of File…
Vidya
  • 21
  • 3
  • 9
0
votes
1 answer

Looking for a Java File Util class that uses NIO.2

According to the official Java Tutorial, the best way to write into a file is: http://docs.oracle.com/javase/tutorial/essential/io/file.html#channels Before I create my own FileUtil.write(file, text) method using NIO.2, I wonder if there already is…
Daniel Nuriyev
  • 565
  • 5
  • 10
0
votes
3 answers

Java NoClassDefFoundError for commons-io?

I have the following directory structure: somedir/ lib/ myapp.jar commons-io-2.1.jar ...lots of otherjars From inside somedir, I try to run the following command: java -cp lib/* net.myapp.Driver…
0
votes
1 answer

Java File commands over SSH

I'm creating a java program which does a lot over ssh. In my program, I need to be able to run methods such as "listFiles()" on a remote host. I also need to be able to run a couple commands from Apache Commons io (I'm using the "FileUtils" class).…
Taconut
  • 891
  • 3
  • 10
  • 27
0
votes
2 answers

Java - commons-io - listFiles non-recursively

I want to use Apache Commons IO's FileUtils.listFiles to find all files in a directory but do not want to perform the search recursively. I can list all files recursively like so: FileUtils.listFiles(directory, new…
Sean Connolly
  • 5,444
  • 7
  • 33
  • 67
0
votes
0 answers

Download of a file in Java from URL via HttpEntity and IOUtils - An infinite loop?

I use some Apache Commons libraries. In particular, I'm using version 4.2.5 of httpclient and version 2.4 of commons-io. Thus, using a DefaultHttpClient I try to download pdf files from URLs. E.g. Suppose that I want to download this file:…
mat_boy
  • 10,930
  • 19
  • 62
  • 103
0
votes
2 answers

Error on " mvn install " with commons-io (1.4)

I have an issue when I launch the " mvn install " commande, my level with Maven is "curious begginer" I'm on : OS : windows XP, Maven : 2.0.7, java : 1.6.0_29 and I launch maven with a cmd consol in my pom.xml, I have :
adrien olivier
  • 115
  • 1
  • 10
0
votes
1 answer

Spring MVC file upload via MultipartFile gives sometimes(!) empty InputSteam

we encountered a strange problem with our simple file upload system. The setup is: Spring 3.2.2, commons fileupload 1.3, commons io 2.4. We're actually running straight from Eclipse with an external Tomcat 7.0.40. It's been tested on Mac OS X 10.8…
0
votes
2 answers

Apache Commons File Upload-getting correpted file after upload

I successfully uploaded a text file (say Another.java) using the following code, but it gives me an error while trying to open the uploaded file. Thanks in advance. fileUpload.jsp
Visruth
  • 3,138
  • 30
  • 45
0
votes
1 answer

RegexFileFilter behaves differently when running in jboss 7

I need to sort files based on their name and extension. I use apache commons-io RegexFileFilter for that. The filename pattern is something like this: "filename.xml.20130101200" or "filename.xml.20130101200.inprog", where numbers are simple…
jyriand
  • 2,248
  • 3
  • 18
  • 27
0
votes
2 answers

Scanner to reset pointer at previous line

My problem could be solved if Scanner class had previous() method on it. I am asking this question to know if there are any methods to achieve this functionality. Input: a file with contents…
Mahi G
  • 361
  • 1
  • 5
  • 13
0
votes
1 answer

Util method to get Line by Line#

Is there any Util method to get the line contents by Line# from given file?
Mahi G
  • 361
  • 1
  • 5
  • 13
0
votes
1 answer

Search recursively for files with certain ending, avoiding SVN folders

I want to search for files with its name ending in "_1.xml" into a folder (UNIX filesystem, I'm searching into /home/myuser/myfolder/). I would like to avoid svn folders: I don't know if they can give me errors, that's why I want to avoid them. If…
Roman Rdgz
  • 11,378
  • 36
  • 110
  • 192
0
votes
2 answers

MacRoman vs UTF-8

I am try to pull out byte data from a source, encrypt it, and then store it in the file system. For encryption, I am using jasypt and the BasicTextEncryptor class. And for storing on to the file system, I am using Apache's Commons IOUtils…
1 2 3
11
12