Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-23-2008, 09:19 AM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 144
Rep Power: 0
jazz2k8 is on a distinguished road
Default [SOLVED] Folder watch Issue
Here is my requirement:
I have a folder in which files will be placed for a particular interval of time.But I am facing a problem after picking two files.Code is running continuosly but from third file it is not picking.




If you have any simple method can you please let me know....:-)

Thanks
__________________
visit : www.yoteam.co.cc

Last edited by jazz2k8; 07-23-2008 at 02:24 PM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-23-2008, 09:41 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Is that your third file is exist when you picking. Basically did you close all streams and all in correct way before picking it. Did you picking files in a specific interval?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-23-2008, 09:54 AM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 144
Rep Power: 0
jazz2k8 is on a distinguished road
Default
yes the third file exists.

As soon as the file comes into the folder,jva program should pick that file and disply the file name.This is working fine for first two files.Then after it is not displaying the file name.

Thanks
__________________
visit : www.yoteam.co.cc
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-23-2008, 10:03 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
You get any exception there?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-23-2008, 10:09 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
What'a you getName() method do for file array? It's not a valid method I think.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 07-23-2008, 12:23 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 144
Rep Power: 0
jazz2k8 is on a distinguished road
Default
getName() is for only to get the name of the file..The programming is running with out any exceptions...but the third file onwards it is not picking any....
__________________
visit : www.yoteam.co.cc
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 07-23-2008, 12:36 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Yes, but I'm worried how you code works. Did you notice the error on this line.

Code:
if (currentFiles.getName().equals(existingFiles2[j].getName())) {
Actually you have done the same mistake in another line of the above code.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 07-23-2008, 12:40 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
How did you create new files to picking up. Can you show the code, I can't test it, and lazy to handle it by hand now.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 07-23-2008, 01:10 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 144
Rep Power: 0
jazz2k8 is on a distinguished road
Default
here i am ataching the screen shots ..

when asset.txt loaded into the folder it is taking as No of NewFiles as 1 and it picked up that file name.Even for second too contract.txt....from there it is not picking the third file name....
Attached Files:
File Type: zip output.zip (76.3 KB, 1 views)
__________________
visit : www.yoteam.co.cc
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 07-23-2008, 01:14 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
I hope the issue with your application is about threads. Or your list may be empty when you search. Since you use NetBeans easy to debug and see. Have you tried it?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 07-23-2008, 01:18 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 144
Rep Power: 0
jazz2k8 is on a distinguished road
Default
Let me try that
__________________
visit : www.yoteam.co.cc
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 07-23-2008, 01:22 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Yes, you should do it at first time you comes with this case jazz. It's the simple way to find the error. Have a try and see. Specially check the list content, each file is exist before pick.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #13 (permalink)  
Old 07-23-2008, 02:23 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 144
Rep Power: 0
jazz2k8 is on a distinguished road
Default
ITs Done....Thanks for time and support
__________________
visit : www.yoteam.co.cc
Bookmark Post in Technorati
Reply With Quote
  #14 (permalink)  
Old 07-24-2008, 06:46 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Nice, did you find it on debug? I hope so, and that's the best way to do such thing in nicer way.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Folder Watching jazz2k8 New To Java 8 07-04-2008 02:49 PM
folder cloning jad Advanced Java 1 07-01-2008 01:28 AM
add password to folder ismailsaleh AWT / Swing 1 01-08-2008 06:46 AM
how to use class in upper folder osval New To Java 1 08-06-2007 09:55 PM
creation of new folder in the mail an8086 Advanced Java 1 07-15-2007 06:10 PM


All times are GMT +2. The time now is 09:26 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org