• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File-listFiles()

 
Alec Porter
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'm trying to get the class files by calling listFiles()



For the parent file I'm getting my class directory which is what I want.



but it's returning null. On the java API it says for that method that "If this abstract pathname does not denote a directory, then this method returns null. " Event though I know it has the correct directory I need and there are files in it. So why does this happen?
 
Andrey Kozhanov
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe your problem is in URL-encoded name of the directory you want. Replacing %20 with spaces should solve the problem.
 
Alec Porter
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it doing that and how do I fix it?
 
Andrey Kozhanov
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is just my suggestion, so no idea why this is happening. But to check whether i am right is rather easy:
 
Alec Porter
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well that fixed it. Thanks, not sure why it does that though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic