|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

07-23-2008, 10:19 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 112
|
|
|
[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 : To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Last edited by jazz2k8 : 07-23-2008 at 03:24 PM.
|
|

07-23-2008, 10:41 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 10:54 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 112
|
|
|
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 : To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 11:03 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
You get any exception there?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 11:09 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 01:23 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 112
|
|
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 : To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 01:36 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
Yes, but I'm worried how you code works. Did you notice the error on this line.
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 01:40 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 02:10 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 112
|
|
|
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....
__________________
visit : To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 02:14 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 02:18 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 112
|
|
|
Let me try that
__________________
visit : To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 02:22 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-23-2008, 03:23 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 112
|
|
|
ITs Done....Thanks for time and support
__________________
visit : To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

07-24-2008, 07:46 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|