Search Results

Search found 3 results on 1 pages for 'jnotify'.

Page 1/1 | 1 

  • Using the JNotify library, how can you tell if a deleted file was a file or a directory?

    - by Moeri
    For those unfamiliar with JNotify, this is a library which provides an easy way to monitor events in a directory. For instance, when a file gets deleted in the selected folder, the method "fileDeleted" gets called, along with a few parameters. Here's an example of the fileDeleted method: public void fileDeleted(int wd, String rootPath, String name) { print("deleted " + rootPath + " : " + name); } Now, I would like to know if the deleted file was a file or directory. My usual approach is to create a new File object with the given path, and use the methods isFile() and isDirectory() However, since this file is already deleted, these methods always return false. So here's my concrete question: I have the path to a deleted file or directory, how can I tell wether it was a file or a directory? Is there a workaround to this? What's the best practice to do here? Thank you in advance.

    Read the article

  • JQUERY - how to get updated value after ajax removes data from within it?

    - by Brian
    I have a an element with thumbnails. I allow users to sort their display order (which fires off an update to the DB via ajax). I also allow them to delete images (which, after deletion, fires off a request to update the display order for all remaining images). My problem is with binding or live I think, but I don't know where to apply it. The array fired off upon delete contains ALL the ids for the images that were there on page load. The issue is that after they delete an image the array STILL contains the original ids (including the one that was deleted) so it is obviously not refreshing the value of the element after ajax has removed things from inside it. I need to tell it to go get the refreshed contents... From what I have been reading, this is normal but I don't understand how to tie it into my routine. I need to trigger the mass re-ordering after any deletion. Any ideas gurus? $('a.delimg').click(function(){ var parent = $(this).parent().parent(); var id = $(this).attr('id'); $.ajax({ type: "POST", url: "../updateImages.php", data: "action=delete&id=" + id, beforeSend: function() { parent.animate({'backgroundColor':'#fb6c6c'},300); $.jnotify("<strong>Deleting This Image & Updating The Image Order</strong>", 5000); }, success: function(data) { parent.slideUp(300,function() { parent.remove(); $("#images ul").sortable(function() { //NEEDS TO GET THE UPDATED CONTENT var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; $.post("../updateImages.php", order, function(theResponse){ $.jnotify("<strong>" + theResponse + "</strong>", 2000); }); }); }); } }); return false; }); Thanks for any help you can be.

    Read the article

  • Monitor file in Java on Linux 64bits

    - by Tim
    I'd like to be notified when a file has been created, deleted or changed, but not using polling mechanism. I have surveyed related Java API that can use.(EX:JNotify, JPathWatch and JXFileWatcher) Those APIs provide file monitor by using native component on OS. But I met the same problem is that they can't run on Linux 64bits, because native component in those APIs donen't support Linux 64bits, and this confused me for a long time. I also know that there'll be a WatchService API as part of NIO2 in JDK7, but JDK7 has not released yet. So, can any one suggest me a better solution? Very Thanks.

    Read the article

1