apache-commons-io Questions

4

I had a problem with reading /proc/%d/stat files using my Java method copyFiles() (source code below). I have found workaround using similar readProc() method. Now I am wondering what was the prob...
Funnelform asked 16/8, 2011 at 12:8

13

Solved

I want to delete all files inside ABC directory. When I tried with FileUtils.deleteDirectory(new File("C:/test/ABC/")); it also deletes folder ABC. Is there a one liner solution where I can delet...
Bland asked 2/11, 2012 at 13:4

2

Solved

Commons-IO has an IOUtils.toString(inputStream) method, which can read all content from an input stream: InputStream input = getInputStream(); String content = IOUtils.toString(input); My questi...
Eipper asked 7/12, 2013 at 15:41

6

Android Studio Version 3.2 (AI-181.5540.7.32.5014246). In Android Studio 3.1, I was able to build SignedAPK successfully. But as soon as I made Android Studio 3.2, I could not build a SignedAPK at...
Squeegee asked 27/9, 2018 at 2:25

1

I am using commons-io in my project and want to shade it. I am running into a warning that I can't seem to figure out: [WARNING] commons-io-2.7.jar, murder-1.0-SNAPSHOT.jar define 180 overlapping c...
Antemundane asked 30/8, 2020 at 16:38

4

Solved

I am a beginner at programming with Java and am currently writing an application which must be able to compress and decompress .zip files. I can use the following code to decompress a zipfile in Ja...
Stace asked 27/4, 2014 at 1:32

0

Kind Attn Moderators: Before marking this query as duplicate, please note I have checked these questions... java.net.SocketException: Connection reset What's causing my java.net.SocketExceptio...
Ontina asked 14/12, 2019 at 5:31

3

my code is given below . public static void main(String[] args) { // TODO code application logic here File pcounter_log = new File("c:\development\temp\test.log"); try { TailerListener listen...
Petrography asked 7/5, 2011 at 13:34

4

Solved

Is this code BufferedWriter bw = new BufferedWriter(new FileWriter("test.txt")); try { bw.write("test"); } finally { IOUtils.closeQuietly(bw); } safe or not? As far as I understand when w...
Readability asked 21/1, 2013 at 10:17

2

Solved

I've been working on the following issue for several hours, but haven't come up with a way to solve my problem. I've tried the following fixes from Stack Overflow (Android Studio update to 1.0 corr...

4

Solved

I have a java process that is hanging in a call to IOUtils.toString with the following code: String html = ""; try { html = IOUtils.toString(someUrl.openStream(), "utf-8"); // process hangs on th...
Brindle asked 25/9, 2013 at 9:0

1

Solved

I need to develop an application that will process csv files as soon as the files are created in a predefined directory. Huge number of incoming files is expected. I have seen applications using A...
Commodity asked 1/10, 2015 at 12:14

2

Solved

I have a file that is 21.6GB and I want to read it from the end to the start rather than from the beginning to the end as you would usually do. If I read each line of the file from the start to th...
Taliataliaferro asked 19/9, 2016 at 20:58

2

Solved

I'm using the answer on How to convert InputStream to virtual File which uses org.apache.commons.io.IOUtils to copy the given InputStream to a FileOutputStream in order to create a File. Should I ...
Slipon asked 26/4, 2016 at 10:3

9

Solved

Is there any method to read a specific line from a text file ? In the API or Apache Commons. Something like : String readLine(File file, int lineNumber) I agree it's trivial to implement, but i...
Harper asked 26/1, 2010 at 9:12

1

Solved

How to make FileAlterationObserver to observe a remote directory? This can accept a String path or a Java File. Both the cases it will look for the directory in local context. I have a directory i...
Wattage asked 5/2, 2016 at 6:40

1

Solved

I am running the following code package test.commons; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; public class Try_FileUtilsWrite { public static ...
Siward asked 6/4, 2015 at 15:42

1

I'm trying to find a more efficient method of reading a file from a remote URL and saving it into a byte array. Here is what I currently have: private byte[] fetchRemoteFile(String location) throw...
Koval asked 18/11, 2014 at 18:56

1

I have an Android project (Gradle) where I need to include both Joda Time and Commons IO libraries. This is my Gradle file: apply plugin: 'android-library' apply plugin: 'android-test' buildscrip...
Gertudegerty asked 11/8, 2014 at 21:29

1

Solved

I have fairly basic question i'm trying to download a PDF from this URL using java: http://kundservice.svd.se/ui/templates/HttpHandler/PDFTidningen/PDFTidningen.ashx?date=2014-07-27&file=SVD_...
Androecium asked 30/7, 2014 at 8:10

1

Solved

I'm trying to read data from an InputStream, which could either be a FileInputStream or an ObjectInputStream. In order to achieve this I'wanted to clone the stream and try to read the Object and in...
Statutable asked 28/6, 2014 at 21:25

2

I am working on a monitoring program that reads the /var/log/auth.log file. I am using Apache Commons IO Tailer class to read the file in real time. To get started, I wanted to test the real-time r...
Citystate asked 10/4, 2014 at 11:49

1

Solved

I'm trying to list files with the extension ".xls" in the root directory and its sub-directories, using the following code with Apache Commons-IO 2.4 library. I am checking the size of the collecti...
Upspring asked 4/11, 2013 at 20:2

2

Solved

Does anyone know any way of implementing progress bar for Apache's FileUtils.copyDirectory(File src, File dst)? I don't see anything helpful in JavaDocs and API. Seems like a common use case in dea...
That asked 11/7, 2012 at 7:5

6

I want to collect a list of all files under a directory, in particular including subdirectories. I like not doing things myself, so I'm using FileUtils.listFiles from Apache Commons IO. So I have s...
Sanguine asked 23/5, 2009 at 1:50

© 2022 - 2024 — McMap. All rights reserved.