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

utime permission denied in windows 7 when call FileUtils.touch(f)

I'm working with ruby 2.0 on windows 7 (unfortunately I have to) and have issue with this code: FileUtils.touch(file) This code is needed to update file.ctime (which probably will have problems too) So, when files is processed I 'touch' them and…
Extazystas
  • 488
  • 2
  • 11
0
votes
1 answer

Ruby FileUtils alias on Mac?

How do I use Ruby's fileutils to make an alias on Mac's filesystem? Symbolic link would work too, either one. Or would I need to use some sort of shell script to do so?
maxie
  • 1
  • 1
0
votes
2 answers

Clone Iterator FileUtils

Good Morning in my timezone. I have the following code: Iterator files = FileUtils.iterateFiles(new File(directoryPath), new String[]{"java"}, true); for(String file : ws){ while(files.hasNext()){ current =…
tt0686
  • 1,771
  • 6
  • 31
  • 60
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,692
  • 7
  • 37
  • 74
0
votes
0 answers

FileUtils.copyDirectory() error with thumbs.db/desktop.ini (Access denied) java

I'm trying to copy a folder full of .txt and .jpg files into a separate folder. From: C:/Folder/resources/ To: C:/Folder/backup/resources public void backup() throws IOException { FileUtils.copyDirectory(new File(SOURCE), new…
atkHOBO
  • 83
  • 1
  • 1
  • 4
0
votes
4 answers

how to search for a file in windows using java

i want to search for a file in windows just by giving the name of the file,intially i tried to list out all files using this piece of code File[] files = File.listRoots(); for(File f : files){ parseAllFiles(f.getPath()); } …
user1585111
  • 1,019
  • 6
  • 19
  • 35
0
votes
1 answer

File not found when is a space in a filename with FileUtils.copyURLToFile

I am using FileUtils to save from internet some files like this: FileUtils.copyURLToFile( new URL(urlPath), new File(destinationPath)); But when trying to download a file which has a space in the…
0
votes
0 answers

Rails FileUtils and File.rename keep deleteing files

I'm trying to iterate through a directory of image files and rename them. Each time I run this method it will rename one file and delete the rest. I also used File.rename. require 'fileutils' def rename_image_files @last_product =…
DaveyGravy
  • 21
  • 5
0
votes
1 answer

FileUtils writelines "not applicable for arguements"?

File spf = new File(setspath); // List lst = new List(); lst.add(sourcej); lst.add(folname); lst.add(chosenBackup); // FileUtils.writeLines(spf, lst); I get this error "The method writeLines(File, Collection) in the type FileUtils is not…
Edwin Grace
  • 5
  • 1
  • 2
0
votes
1 answer

Download attachment from mail using ContextIO and upload it on server

I am new to Rails and Context.IO. I am trying to create a record in my database based on values fetched from mail. I am trying to fetch mail attachment and download that onto a directory in my /public on my server using contextio. I have…
Nikunj Thakkar
  • 351
  • 1
  • 4
  • 8
0
votes
1 answer

Save pictures in a specific folder with Java

I'm trying to save the images extracted from a. doc file in a temporary folder. The folder I was able to create it and also the images were extracted but I have no idea how to save them in the folder. Can you help? This is what has been done so…
YoBre
  • 2,520
  • 5
  • 27
  • 37
0
votes
1 answer

Ruby on Rails: FileUtils relative to server root?

When using PHP, any file manipulation is done relative to the server root, so something like mkdir("/home/website/public_html/a_directory would be used to create a directory in the public_html folder where the script is executed from. In Rails,…
Stefan Dunn
  • 5,363
  • 7
  • 48
  • 84
0
votes
2 answers

How to read a large file using Nio2

I am trying to read a text file which has around 3 lakh lines as of now. How am I reading? I am reading using the java.io.BufferedReader Here is a small code snippet which represents my approach. int lineNumber = 1; BufferedReader br =…
srk
  • 4,857
  • 12
  • 65
  • 109
0
votes
1 answer

How to list all files with a specific extension fast and efficiently from a SD card in android?

I am trying to build an android app which lists all the files from the SD card that contain a specific extension. For e.g: pdf,mp3,txt etc. I have tried using the android MediaStore class' getContentURI method.…
Nikhil Joshi
  • 97
  • 1
  • 6
0
votes
3 answers

Java Servlet Downloading File

So I have two files, the servlet: package com.servlets; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.servlet.ServletException; import…
Kevin Lee
  • 1,104
  • 3
  • 13
  • 33