Skip to content
Advertisement

Tag: file

Android File.listFiles() returns only subdirectories

I am trying to get all files and subdirectories in directory and show their names. This is the code I use: The specified directory(Environment.getExternalStorageDirectory()) contains files and subdirectories, but listFiles() only returns subdirectories. What’s wrong with this code? Permission to read external storage has already been granted. Answer My fault, I missed something. In Android 11, you can only access

NoSuchFileException java

So I’m currently working on a java fx project and I am trying to get my program to read 2 txt files (name.txt) and (password.txt). When I run this in IntelliJ it works as intended but when I run the jar file in power shell I get this: the code that is supposed to tell where to look at the

Reading in a .txt file in Java

I am trying to write a program which reads in a a list of nodes that interact with each other within a network. This is written in a text file in the format: This indicates node1 interacts with node2 and node3, node 2 interacts with only node3 etc. The program will be able to read in this file and will

Extraction of string and integer from txt

I’m trying to make a simple scanner reader to read from a txt stored in C:UsersjamesDesktopprojectfiles and it’s called data “data.txt”, the thing is that the information stored is like this: So as you can see the spaces between the string and the integer that I want o extract are random. I was trying to make this: But the split

cannot decrypt String from text file [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question In my journey to mastering Java, I started doing some AES encryption and

Advertisement