[jira] [Commented] (VFS-268) When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it
[ https://issues.apache.org/jira/browse/VFS-268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14265202#comment-14265202 ] Sam Halliday commented on VFS-268: -- @Samodelkin have a look at VFS-536 and see if it might be related. In any case, your patch is out of date with master, could you please re-upload it as a `.diff` file? When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it -- Key: VFS-268 URL: https://issues.apache.org/jira/browse/VFS-268 Project: Commons VFS Issue Type: Bug Environment: Windows listening on directory on unix or windows Reporter: John Attachments: DefaultFileMonitorPatched.java I am using a DefaultFileMonitor within a FileListener to listen on a directory. I get different behavior when I set the monitor delay to 0 and non zero. When I set it to 0 and add files to the directory, the createfile event is triggered, I move the files out of the directory. If I add the same files back into the directory, the create event is again triggered. If I set the delay to 6, the first time the files are added the event is triggered, I move the files out of the directory. When I add the files back into the directory, the create event does not trigger (i.e. it triggers the first time, but only the first time). The only difference between the situations is 1 has delay set to 6, the other sets it to 0 ( and I see in the code that that causes a delay of 1000). Here is a snippet of the pertinent code.Thanks for any information/assistance you can find time to give. public FileMessageListener(String dataArea, ReceiverDetail receiverRecord, FileObject fileDirectoryObject, FileObject errorDirectoryObject, FileObject processedDirectoryObject, long FileAccessCheckTime) throws Exception { this.dataArea = dataArea; this.channel = receiverRecord.getKey().channel; this.receiver = receiverRecord.getKey().receiver; this.processDefinition = receiverRecord.processDefinition; this.sendFileData = receiverRecord.filereceiverSendFileData; this.fileDirectoryObject = fileDirectoryObject; this.errorDirectoryObject = errorDirectoryObject; this.processedDirectoryObject = processedDirectoryObject; this.caseinsensitive = (System.getProperty(os.name).indexOf(Windows) = 0); this.regexString = getRegexString(receiverRecord.filereceiverFileName); this.fileMonitor = new DefaultFileMonitor(this); this.fileMonitor.setDelay(1000 * 60 * FileAccessCheckTime); // Recursive needs to be set before files are added to the monitor. fileMonitor.setRecursive(false); fileMonitor.addFile(fileDirectoryObject); fileMonitor.start(); etc... -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (VFS-268) When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it
[ https://issues.apache.org/jira/browse/VFS-268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987167#comment-13987167 ] Bernd Eckenfels commented on VFS-268: - Hm, nut sure I understand, the above code is not conditional? Can you add a real diff? When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it -- Key: VFS-268 URL: https://issues.apache.org/jira/browse/VFS-268 Project: Commons VFS Issue Type: Bug Environment: Windows listening on directory on unix or windows Reporter: John Attachments: DefaultFileMonitorPatched.java I am using a DefaultFileMonitor within a FileListener to listen on a directory. I get different behavior when I set the monitor delay to 0 and non zero. When I set it to 0 and add files to the directory, the createfile event is triggered, I move the files out of the directory. If I add the same files back into the directory, the create event is again triggered. If I set the delay to 6, the first time the files are added the event is triggered, I move the files out of the directory. When I add the files back into the directory, the create event does not trigger (i.e. it triggers the first time, but only the first time). The only difference between the situations is 1 has delay set to 6, the other sets it to 0 ( and I see in the code that that causes a delay of 1000). Here is a snippet of the pertinent code.Thanks for any information/assistance you can find time to give. public FileMessageListener(String dataArea, ReceiverDetail receiverRecord, FileObject fileDirectoryObject, FileObject errorDirectoryObject, FileObject processedDirectoryObject, long FileAccessCheckTime) throws Exception { this.dataArea = dataArea; this.channel = receiverRecord.getKey().channel; this.receiver = receiverRecord.getKey().receiver; this.processDefinition = receiverRecord.processDefinition; this.sendFileData = receiverRecord.filereceiverSendFileData; this.fileDirectoryObject = fileDirectoryObject; this.errorDirectoryObject = errorDirectoryObject; this.processedDirectoryObject = processedDirectoryObject; this.caseinsensitive = (System.getProperty(os.name).indexOf(Windows) = 0); this.regexString = getRegexString(receiverRecord.filereceiverFileName); this.fileMonitor = new DefaultFileMonitor(this); this.fileMonitor.setDelay(1000 * 60 * FileAccessCheckTime); // Recursive needs to be set before files are added to the monitor. fileMonitor.setRecursive(false); fileMonitor.addFile(fileDirectoryObject); fileMonitor.start(); etc... -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (VFS-268) When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it
[ https://issues.apache.org/jira/browse/VFS-268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13285622#comment-13285622 ] Samodelkin commented on VFS-268: DefaultFileMonitor.java {code} // If the file existed and now doesn't if (this.exists !this.file.exists()) { this.exists = this.file.exists(); this.timestamp = -1; // Fire delete event ((AbstractFileSystem) this.file.getFileSystem()).fireFileDeleted(this.file); // Remove listener in case file is re-created. Don't want to fire twice. if (this.fm.getFileListener() != null) { this.file.getFileSystem().removeListener(this.file, this.fm.getFileListener()); } // Remove from map this.fm.queueRemoveFile(this.file); } {code} {color:red} this.fm.queueRemoveFile(this.file); {color} is the culprit When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it -- Key: VFS-268 URL: https://issues.apache.org/jira/browse/VFS-268 Project: Commons VFS Issue Type: Bug Environment: Windows listening on directory on unix or windows Reporter: John Priority: Blocker I am using a DefaultFileMonitor within a FileListener to listen on a directory. I get different behavior when I set the monitor delay to 0 and non zero. When I set it to 0 and add files to the directory, the createfile event is triggered, I move the files out of the directory. If I add the same files back into the directory, the create event is again triggered. If I set the delay to 6, the first time the files are added the event is triggered, I move the files out of the directory. When I add the files back into the directory, the create event does not trigger (i.e. it triggers the first time, but only the first time). The only difference between the situations is 1 has delay set to 6, the other sets it to 0 ( and I see in the code that that causes a delay of 1000). Here is a snippet of the pertinent code.Thanks for any information/assistance you can find time to give. public FileMessageListener(String dataArea, ReceiverDetail receiverRecord, FileObject fileDirectoryObject, FileObject errorDirectoryObject, FileObject processedDirectoryObject, long FileAccessCheckTime) throws Exception { this.dataArea = dataArea; this.channel = receiverRecord.getKey().channel; this.receiver = receiverRecord.getKey().receiver; this.processDefinition = receiverRecord.processDefinition; this.sendFileData = receiverRecord.filereceiverSendFileData; this.fileDirectoryObject = fileDirectoryObject; this.errorDirectoryObject = errorDirectoryObject; this.processedDirectoryObject = processedDirectoryObject; this.caseinsensitive = (System.getProperty(os.name).indexOf(Windows) = 0); this.regexString = getRegexString(receiverRecord.filereceiverFileName); this.fileMonitor = new DefaultFileMonitor(this); this.fileMonitor.setDelay(1000 * 60 * FileAccessCheckTime); // Recursive needs to be set before files are added to the monitor. fileMonitor.setRecursive(false); fileMonitor.addFile(fileDirectoryObject); fileMonitor.start(); etc... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-268) When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it
[ https://issues.apache.org/jira/browse/VFS-268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13285632#comment-13285632 ] Samodelkin commented on VFS-268: attached a patched version with conditional removal flag When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it -- Key: VFS-268 URL: https://issues.apache.org/jira/browse/VFS-268 Project: Commons VFS Issue Type: Bug Environment: Windows listening on directory on unix or windows Reporter: John Priority: Blocker Attachments: DefaultFileMonitorPatched.java I am using a DefaultFileMonitor within a FileListener to listen on a directory. I get different behavior when I set the monitor delay to 0 and non zero. When I set it to 0 and add files to the directory, the createfile event is triggered, I move the files out of the directory. If I add the same files back into the directory, the create event is again triggered. If I set the delay to 6, the first time the files are added the event is triggered, I move the files out of the directory. When I add the files back into the directory, the create event does not trigger (i.e. it triggers the first time, but only the first time). The only difference between the situations is 1 has delay set to 6, the other sets it to 0 ( and I see in the code that that causes a delay of 1000). Here is a snippet of the pertinent code.Thanks for any information/assistance you can find time to give. public FileMessageListener(String dataArea, ReceiverDetail receiverRecord, FileObject fileDirectoryObject, FileObject errorDirectoryObject, FileObject processedDirectoryObject, long FileAccessCheckTime) throws Exception { this.dataArea = dataArea; this.channel = receiverRecord.getKey().channel; this.receiver = receiverRecord.getKey().receiver; this.processDefinition = receiverRecord.processDefinition; this.sendFileData = receiverRecord.filereceiverSendFileData; this.fileDirectoryObject = fileDirectoryObject; this.errorDirectoryObject = errorDirectoryObject; this.processedDirectoryObject = processedDirectoryObject; this.caseinsensitive = (System.getProperty(os.name).indexOf(Windows) = 0); this.regexString = getRegexString(receiverRecord.filereceiverFileName); this.fileMonitor = new DefaultFileMonitor(this); this.fileMonitor.setDelay(1000 * 60 * FileAccessCheckTime); // Recursive needs to be set before files are added to the monitor. fileMonitor.setRecursive(false); fileMonitor.addFile(fileDirectoryObject); fileMonitor.start(); etc... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-268) When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it
[ https://issues.apache.org/jira/browse/VFS-268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13114050#comment-13114050 ] Ralph Goers commented on VFS-268: - Are you deleting and re-adding the file during the 60 second window? If so, from the perspective of the monitor the file was never deleted. When you set the delay to zero it is actually being set to the default of 1 second. When I set a delay on FileMonitor it detects a create on a file, but if the file is deleted/moved and created in the directory again it does not detect it -- Key: VFS-268 URL: https://issues.apache.org/jira/browse/VFS-268 Project: Commons VFS Issue Type: Bug Environment: Windows listening on directory on unix or windows Reporter: John Priority: Blocker I am using a DefaultFileMonitor within a FileListener to listen on a directory. I get different behavior when I set the monitor delay to 0 and non zero. When I set it to 0 and add files to the directory, the createfile event is triggered, I move the files out of the directory. If I add the same files back into the directory, the create event is again triggered. If I set the delay to 6, the first time the files are added the event is triggered, I move the files out of the directory. When I add the files back into the directory, the create event does not trigger (i.e. it triggers the first time, but only the first time). The only difference between the situations is 1 has delay set to 6, the other sets it to 0 ( and I see in the code that that causes a delay of 1000). Here is a snippet of the pertinent code.Thanks for any information/assistance you can find time to give. public FileMessageListener(String dataArea, ReceiverDetail receiverRecord, FileObject fileDirectoryObject, FileObject errorDirectoryObject, FileObject processedDirectoryObject, long FileAccessCheckTime) throws Exception { this.dataArea = dataArea; this.channel = receiverRecord.getKey().channel; this.receiver = receiverRecord.getKey().receiver; this.processDefinition = receiverRecord.processDefinition; this.sendFileData = receiverRecord.filereceiverSendFileData; this.fileDirectoryObject = fileDirectoryObject; this.errorDirectoryObject = errorDirectoryObject; this.processedDirectoryObject = processedDirectoryObject; this.caseinsensitive = (System.getProperty(os.name).indexOf(Windows) = 0); this.regexString = getRegexString(receiverRecord.filereceiverFileName); this.fileMonitor = new DefaultFileMonitor(this); this.fileMonitor.setDelay(1000 * 60 * FileAccessCheckTime); // Recursive needs to be set before files are added to the monitor. fileMonitor.setRecursive(false); fileMonitor.addFile(fileDirectoryObject); fileMonitor.start(); etc... -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira