Questions tagged [fileutils]
FileUtils is a File manipulation utility from Apache Commons
fileutils
236
questions
-2
votes
1
answer
66
views
Cannot copy file to windows 11 file system - if you are running this code in the linux server
I'm doing a download from java apps running on linux. The following is the code:
public void downloadCopyToFile(String filename, String outFilename) throws IOException {
try {
...
-1
votes
1
answer
69
views
Java - org.apache.commons.io.FileUtils.copyFileToDirectory(sourceFile, destination) is failing to copy file
private void copyFile() {
try {
String data = "C:\\Test_data\\My_Folder\\data";
String destination = "D:\\test\\CC";
File destDir = new File(destination)...
0
votes
1
answer
61
views
Sorting files by created date using FileUtils Apache
Is there a way to sort files in a directory using FileUtils Apache? I wan't to sort the files by the date they are created...
I have tried the following code:
public String[] getPDFFiles (String dir) ...
-2
votes
1
answer
182
views
Java : Convert an Inputstream string into file
I am trying to write a String (read from an InputStream) into a file.
But when the output.pdf file is generated, it is corrupted.
In real-world scenario, I am receiving a string as an input from ...
1
vote
0
answers
43
views
xUnit Jenkins Plugin "Cannot create directory"
I'm in the process of writing a declarative Jenkins pipeline as CI for a project. As part of it, I use GoogleTest and feed the generated xml file to an xunit call.
It might be noteworthy that in ...
0
votes
1
answer
149
views
Deleting all files & directories except those matching a given glob pattern
I have a list of all the files & directories that I need to delete, but I need to exclude all files/directories that match a given glob pattern. Any suggestions on how I can achieve this?
I am ...
-1
votes
2
answers
155
views
How can i manage files in my host machine on Docker
I am using Docker on my Windows machine and i want to copy a directory to another directory in my Windows host. I have a Maven project that does this on Windows using org.apache.commons.FileUtils ...
0
votes
1
answer
1k
views
Errno::ENOENT: No such file or directory @ dir_chdir
I have a model Report to export all the Pdf attachments done for the bills. I have other models Bill, Upload.
Bill has many uploads
Tech Stack used
Ruby 2.5.8
Rails 5.0.7
Dummy Code
require '...
0
votes
1
answer
2k
views
How to resolve java.io.IOException: The filename, directory name, or volume label syntax is incorrect
I have written a simple script to take the screenshot but it is giving java.io.IOException The filename, directory name, or volume label syntax is incorrect what's wrong with the code, or is it ...
0
votes
1
answer
478
views
file_utils module import failing in colab
I am trying to run BertForSequenceClassification from within Google Colab. My notebook needs to import BertForSequenceClassification from modeling_readmission, but modeling_readmission.py itself ...
7
votes
2
answers
510
views
Java | Attempting to delete files on a Windows machine results in "phantom files"
I'm trying to delete some files on a windows machine using apache commons-io's FileUtils.deleteDirectory method (The version of the commons library is 2.4). Said method eventually calls the "...
0
votes
0
answers
64
views
Problem with FileUtils.mkdir_p deleting folder contents
My "folder 3" contains "Folder 4A", but when I made a new folder within it, "Folder 4B", my "Folder 4A", and all it's contents got deleted. What is wrong with ...
1
vote
2
answers
661
views
FileUtils write method does not work on Azure Databricks
I have troubles writing a file on my Databricks cluster's driver (as a temp file). I have a scala notebook on my company's Azure Databricks which contains those lines of code :
val xml: String = ...
0
votes
1
answer
2k
views
how to create a utils.py module
I had a def hello() function in my home/file.py. I created a home/common/utils.pyfile and moved the function there.
Then I imported it like this: from utils import hello and the import in my file ...
2
votes
1
answer
616
views
FileUtils: Skips files that are already in destination and copy rest of the files
I am using the following method to transfer files between two directories using java.
FileUtils.copyDirectory(sourceDir, destinationDir,fileFilter,false);
But if a file with the same name is also ...