File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refresh a folder

 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to refresh a folder or the whole project using Java/Spring. When i do a file upload and want to display the tree list, the file gets uploaded and when i try to display it, the file isn't displaying. But once i refresh the folder manually its just displaying. Please help me guys.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's the tree list/folder/project you want to refresh?

Are you talking about the operating system file explorer? your IDE? an application you've developed?

I assume you're talking about the operating system file explorer - there probably isn't a way to do this through Java... the actual file/directory is being created, it's just the file explorer view that's not updating to show it.

What OS are you using? If I search Google for "Windows file explorer doesn't refresh when new file" most of the top results are for some issues with Windows 7.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the project file directory is what i want to refresh.
Dir structure is

PRJ1
--WebContent
--WEB-INF
--images
--src
--package root

Now i need to refresh the images folder so that it'll display the uploaded image in the JSP Page. I want to do it programmatic-ally using Java.

Is it possible to do so?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no way to "refresh" the file system... this is just an artifact of windows explorer. Either a file exists or it doesn't, it's not like you upload/copy/create a file and it doesn't exist until you refresh the directory. How is your JSP getting the file to show?
 
Justin Brown
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this thread is a little old but I had a similar problem and putting Thread.sleep(2000); right after the update fixed the problem.
 
Geeta Puttappanavar
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I too have the same requirement to upload a file, from which a graph will be generated(garph image will be saved in web content/image folder) and I need to display the image to user.

My problem is that for different files the graphs are generating and everything is working fine locally. But when I try using IP address, the image is not displaying (X mark displaying). When I refresh the image folder then the image is getting displayed.

Thanks in advance,
Geeta
 
Geeta Puttappanavar
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any of you help me please?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic