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

234 questions
0
votes
1 answer

Moving files to a directory created on the fly

I'm looking to move certain .txt files from one directory to another, that I'm creating on the fly containing version numbers and date/time stored as variables: require 'fileutils' version = '2.1.6.0' time = Time.now.strftime("%Y%m%d%H%M%S") dir =…
user3927287
  • 193
  • 1
  • 4
  • 13
0
votes
2 answers

Insufficient System resources exist to complete the requested services

Getting the above error when trying to download large data using HttpGet String uri = ""; getMethod = executeGet(uri); httpClient.executeMethod(getMethod); InputStream istream = getMethod.getResponseBodyAsStream(); byte[] data =…
user3798050
  • 39
  • 1
  • 1
  • 3
0
votes
2 answers

file.delete() only works the first time

at the moment I am writing a small programm to check whether a file is in a database or not. Moreover I check whether the hash in the database has been computed correctly (here: sha256). The filename is the (old and maybe wrong) sha from the…
Hisushi
  • 67
  • 1
  • 11
0
votes
2 answers

Run A Java Program That Calls On An External Jar

I'm trying to run a Java program that calls on the C:\Users\Brandon\Downloads\commons-io-2.4 folder. It compiled fine with this code javac -cp "C:\Users\Brandon\Downloads\commons-io-2.4\*" Login.java but when I tried to run it with this code …
brandon Whe
  • 206
  • 1
  • 14
0
votes
1 answer

Ruby: How to delete files and folders under C:\Users\ for specified Username

Basically I want to create a program that can delete 3 directories and a file in preparation for a software's "Rebuild" that needs to be done every so often for troubleshooting purposes. The problem is, it needs to be used on multiple computers…
Pan7h3r
  • 5
  • 2
0
votes
1 answer

commons io FileUtils.writeStringToFile

I have a program written in Java reading two properties files - source.properties and destination.properties and write key/value pair of each line from source to destination. I decided to use FileUtils.writeStringToFile method from apache commons io…
DaeYoung
  • 1,161
  • 6
  • 27
  • 59
0
votes
1 answer

FileUtils.copyDirectory doesn't write date modified correctly unless the Android SD card is unmounted

FileUtils.copyDirectory doesn't write date modified correctly unless the Android SD card is unmounted. Using this simple bit of code from FileUtils: try { FileUtils.copyDirectory(srcDir2, destDir2); } catch (IOException e) { I can…
0
votes
2 answers

Get user name in RubyMotion OSX

I need to get the user's home directory or at least his name. Using FileUtils, I need to move files based on their account name, and using ~/ doesn't seem to work. How would I get the user's account name?
Chris Edwards
  • 3,514
  • 2
  • 33
  • 40
0
votes
1 answer

Can I choose merge precedence, and/or include sub folders when copying directories with FileUtils

I am trying to copy a directory, and do so successfully with Apache Commons IO's FileUtils. I want however to be able to choose if the copy should merge the folders, with either the source or the destination taking precedence. The API-docs tells me…
jumps4fun
  • 3,994
  • 10
  • 50
  • 96
0
votes
3 answers

Apache FileUtils when comparing two identical pdfs keeps returning false

I am using FileUtils to compare two identical pdfs. This is the code: boolean comparison = FileUtils.contentEquals(pdfFile1, pdfFile2); Despite the fact that both pdf files are identical, I keep getting false. I also noticed that when I…
blackpanther
  • 10,998
  • 11
  • 48
  • 78
0
votes
1 answer

Delete file Permission denied in production ruby on rails

I am struggling to delete a file in production mode.I have tried several options that are 1) File.delete(filename) 2) FileUtils.rm_rf(filename) It says permission denied in production mode when i run in development it works fine.Also when i…
0
votes
1 answer

File Upload with spring data - gridfs

Hi i am trying to upload a file using spring data. When i try to upload file, i get an exception. My code for file upload is try { File file = new File(this.TEMPORARY_FILES_DIRECTORY, Calendar.getInstance().getTimeInMillis() + "_" +…
Shahzeb Khan
  • 3,582
  • 8
  • 45
  • 79
0
votes
1 answer

gem install fileutils error

Now I'm trying to open SVG file to get the data from it by Ruby language using Rails 4.0.2 first I installed the " nokogiri " by using this command [ gem install nokogiri ] because I'm using Windows 7 then when I'm trying to install " fileutils "…
Astm
  • 1,519
  • 2
  • 22
  • 30
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
  • 339
  • 2
  • 6
  • 17
0
votes
0 answers

Rails 3: Errno::ENOENT exception

I have the code as following. It runs OK on my local machine `params[:file].each do |f| tmp = f.tempfile ext = File.extname(f.original_filename) basic_file_name = "#{session[:user]["id"]}_#{Time.new.to_i}#{ext}".downcase file =…