Questions tagged [fileutils]

FileUtils is a File manipulation utility from Apache Commons

FileUtils or org.apache.commons.io.FileUtils is File manipulation utility from Apache Commons

221 questions
-1
votes
2 answers

Java 6 - StackOverflowError when trying to copy and paste a file

Java 6 jboss-as-7.1.1.Final I need to copy and paste a file. Using org.apache.commons.io.FileUtils and I tried with the following code, If I invoke sync() from a jsp, getting ... java.lang.StackOverflowError at …
SyAu
  • 1,599
  • 7
  • 23
  • 44
-1
votes
1 answer

What happens on failure with a FileUtils method?

If I don't pass in any options in the options hash, how does FileUtils behave when it fails? I tried looking at FileUtils on ruby-doc.org and APIdock and couldn't find anything.
Andrew Grimm
  • 70,470
  • 47
  • 186
  • 310
-1
votes
1 answer

Issue with org.apache.commons.io.FileUtils and Unix absolute/relative path

I am facing issue with absolute/relative path and org.apache.commons.io.FileUtils on Unix box. Issue is:- I am using cleanDirectory(..) and copyDirectory(..) of FileUtils. It works fine if I use absolute path /userName/data/feeds but gives…
SPS
  • 123
  • 1
  • 2
  • 9
-2
votes
2 answers

FileUtils.copyFile() crashes the program when trying to copy an exe

I have been trying a lot of different options for copying files in Java and none have been working. The one that I was using when I think I found the real issue was FileUtils. Here is the code public void createUSBButtonAction() throws…
-2
votes
1 answer

Find the Mime-Type of a downloaded file

In the code below, how will I find the mime type of the file that just got saved in File object? File fileBase = new File("classpath:test"); try { FileUtils.copyURLToFile( new URL(docUploadDto.getAssetFileUrl()), …
Kiran S
  • 68
  • 1
  • 10
-2
votes
2 answers

Accessing .txt files from inside a folder (java)

I have a similar problem to this question, and I tried the answer that the question accepted: File folder = new File("/path/to/files"); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { File file =…
k1234
  • 663
  • 3
  • 13
  • 21
-2
votes
2 answers

Copying files from directory to other using FileUtils jar

I want to copy files from directory to another, so I searched and I got this post: Copying files from one directory to another in Java I follow the first answer, but I couldn't find the jar of FileUtils and the URL in the comments is broken. Could…
Programer14
  • 155
  • 12
-3
votes
1 answer

Scala : List the files which are greater than a file based on its name with timestamp pattern in it

I have to list out all files which are greater than particular file based on its timestamp in naming pattern in scala. Below is the example. Files…
-3
votes
2 answers

Write Errors to Log File in Ruby

I am trying to capture errors, check for a /tmp directory and then write the error to a logfile in that directory, currently I get: .rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:252:in `mkdir': Permission denied @ dir_s_mkdir - /temp Here is…
mrtriangle
  • 474
  • 9
  • 27
-4
votes
3 answers

Regex pattern for filtering files

I want only files containing a fixed pattern in their name,but my code is copying all the files. code that i am using right now is : File source = new File("Any Source file path"); File[] listOfFiles = source.listFiles(); for (int i = 0; i <…
iymrahul
  • 110
  • 1
  • 1
  • 11
-4
votes
1 answer

Is the approach right?

I have some few files of different extensions like .rdf, .pkg,.fmb,.sql and .ldt. In these files I have to find that some specific keywords are present or not. So for this purpose I used two ways. 1st approach String content =…
Harshita Sethi
  • 1,659
  • 2
  • 19
  • 42
1 2 3
14
15