To know when a file get modified.

HI,
I have a requirement like this.
There is a xml file which the user can modify at any time. My program which is running now should get a notification indicating that file has modified and my program will do corresponding updates. How java can support me to achieve this
Thanks in advance
bye

NO it need not be an xml file. I could be text file
also. What i prefer is , instead of polling every
known interval, get a notification when a change
happens. The flow can go like this(if impl exists)
1) Create a File object.
2) set the listener object for that
3) get a notification when user changes that file.
4) take action
:-) this is not possible right??This is exactly what I am telling you to do, but something has to notice the change in the file. That is why you have a separate thread running in the background to monitor the file (it can check every second if you like it takes about 2 milliseconds to check the file). That thread then triggers whatever action you wish to take. As far as the trigger and the action are concerned, look at the Preferences class (as I mentioned) and its PreferenceListener.
Without monitoring it yourself, how do you think you might get notified of a change? If you simply use the Preferences class as is, then you can get these notifications from the system, but you would no longer have control over where and how the things are stored. On windows it uses the registry, on unix I believe some .rc user file or something to that effect. In this case, your application would definately need to provide an interface for changing these values.

Similar Messages

  • How do you know what folder/file to modify?

    Ok, I've had Sun Support on site and even they couldn't tell me exactly how this works and the Sun Support phone support is clueless...
    All I need to do is change the "look & feel" of the portal so how am I supposed to know what folder/file to modify to get what I need?
    Setup:
    * Nested Tabs setup and working
    * JSPTabContainer contains the following:
    * First Top Tab is:
    <Container name="MyNestedTabContainer" provider="JSPTabContainerProvider" merge="replace">
    * Then first inner tab is thus:
    <Container name="MyHomeTableContainer" provider="JSPTableContainerProvider" merge="replace">
    1) What folder do I modify to change the look of either tab? I tried changing the JSPTabContainer/tabs.jsp and nothing happens. Do I have to change the default/JSPTabContainerProvider/tabs.jsp file instead?
    2) There is also a banner line with "Sun One Portal Server" between the tabs, how do I get rid of this?
    I've spent hours scouring the files using trial and error to try and get rid of simple things like this and almost at the point to chuck the whole thing into the trash can. I could have created a portal using Tiles by now...

    I find it IMPOSSIBLE to believe that this is the
    recommended way to do things.I do not say it is the recommended way, I'm just telling this is a quick way I personally use to do it. Sorry if you do not find my script useful.
    Where or where is all of this directory creation and
    copying of files found in the documentation? I guess it is described in the Portal Server Desktop, look for "sesta" which is an example organization name use there.
    Where does it say that in order to make changes, you have
    to all of this?I do not say you have to do it, neither the documentation. That is just a recommendation I suggest to avoid messing with globally used files, and clearly isolating your work from what is provided with the product.
    Are we just supposed to find it all out via osmosis?I guess tha documentation and this developer's forum are a better option ...
    I am extremely frustrated with this product right now.Sorry about that.
    The display profile merging and the template directories form an extremely powerful tool, but with a learning curve longer that those found with simpler approaches.
    Once you got them though, you'll find they allow you to easily and elegantly cover a very wide range of needs that wouldn't be achievable otherwise.

  • Streaming audio file over the network w JMF. How to know when the file end

    Hi
    I am streaming audio file over the network using JMF. I want to be able to know when a file end so I can close the streaming session.
    Can some one please help
    Thanks

    If you put a ControllerListener on the Processor that's associated with generating the RTP stream, it'll generate an "EndOfMedia" event when the end of the file is reached.

  • HT4757 Does anyone know when we will get RAW compatablility for the great Fujiflim X10 camera? Please.

    Does anyone know when we will get RAW compatibility for the great little Fujifilm X10?
    Thank you.

    No one outside of Apple knows when - or if - support will be added for any device. Just let them know you want it...
    iPhoto menu -> Provide iPhoto Feedback

  • Still not received my tablet as yet ad would like to know when I will get it

    my home phone No is [redacted]  and since i have had that number and my broadband and tv i have no received my tablet and would like to know when i will get it as it has been over 3 months since i signed up with you
    [mod edit: please do not post personal information such as phone numbers on the public board. Thanks!]

    Hi, 
    This is a customer forum so you will need to keep chasing EE on 150 about this issue. If you want to complain then please follow the EE process: http://ee.co.uk/help/safety-and-security/my-digital-life/complaints-code-of-practice
    Thanks, 

  • Let us know when we will get updates for iphone4

    When I will get ios8 for my iphone4?

    Never. iOS 8 requires a dual-core processor, and the iPhone 4 has a single-core one.
    Nobody on these boards knows if there will be any more updates to iOS 7.
    (114247)

  • Does any one know when can I get the wifi bug fixed?

    Tried anything I can do to even invested a new router, nothing changed, still losing connection from time to time, once a minute.
    Does any one know when apple will fix this bug?

    He moved it to another screen, he moved it into a folder, or he turned on restrictions for Safari.
    Check Settings > General > Restrictions.  If restrictions are enabled for Safari, Safari is disabled and its icon is removed from the Home screen.
    You can also reset the home screen layout.  Settings >General > Reset > Reset Home Screen Layout.  That will place all the original apps in their original location with all added apps following in alphabetical order.

  • How do you know when a file is done uploading to idisk?

    Hi,
    I work in film/video and I often put files up on my idisk that others can use or view. Often times my team and I use idisk to share files (pictures, music, program files) so that we can access the material on different computers all around the city.
    However, we can never tell when something has been entirely uploaded to our idisks. One of us will load it up to our idisk, tell the other it's up there, but when that person goes to the idisk, they see the folders, but there is nothing in them. So what we end up doing is checking, and checking, and checking the idisk to see if new files have "popped up" in the last 5 minutes.
    Just so I'm clear, here's what usually happens: I put a folder containing various forms of content on my idisk. It makes the "dong" noise and I see it up there-I click on the folder and all the content is in there. Then the circular clock starts spinning at the bottom of the window and the idisk icon is going through its "syncing" motions. And then I sit and wait for God knows how long because there is no way of telling how long before the files are up on the idisk.
    It's all VERY aggravating and I'm close to closing my idisk accnt and swearing off the whole "mobile me."
    Please, lend me some knowledge because I really like the apple workflows. But this one is seriously putting a damper on everything.

    Perhaps your topic would be better suited for the MobileMe iDisk forum:
    http://discussions.apple.com/forum.jspa?forumID=963
    It's unlikely the MacBook is specific to your problem so you might not get too much help here. I would assume Apple has multiple servers with all the iDisk information spread across the world. It's possible there's a bit of lag while they synchronize. But I don't know that for certain.
    -Doug

  • How Server will know when some client Get disconnected

    Hi...
    I am devloping a chat application.... there are loats of users. and one user can have many friends in his/her list. and showing in two groups as Online And Offline.
    How Chat Server will know what is the user's Status(online or offline) When the user will get disconnected due to Internet failure
    " Let you are a user having 10 friends, and when you loged in, at that time you have 5 online friends and 5 offline friends. lets after some time one of your online friend get disconnected from server due to any kind of netwrk failuer, then how server will know about it."

    When the server tries to write to the socket and verify that it is OK, then it will return an error.

  • Timestamp when the file was modified

    Hello everybody,
    Is there a way to do the following:
    When a forms specific field line is modified, the username (which was used to logon to a computer) and the current time would be entered to a specific field in the form?
    Using: Adobe ES 8.21xxxx
    Many thanx in advance

    You can get the current time in  HH:MM:SS format by using the below syntax in FormCalc.
    $host.messageBox(Num2Time(Time(), "HH:MM:SS"));
    For different formats please check the help in your designer.
    I am not sure about getting the user name from the local computer. I am under the impression that it is not allowed to read the local user specific information for security reasons but I could be wrong.
    Thanks
    Srini

  • How do I know when a file loaded into a Sound object is invalid?

    I'm writing an app that allows the user to play various sound files.
    Some of these files are mp3, but some may also be ogg, wma, etc.  The selection is out of my control, so I need the sound API to tell me if it can't play something.
    To test, I loaded some test files into a sound object like so:
                    var urlRequest:URLRequest = new URLRequest("http://support.microsoft.com/support/MediaPlayer/wmptest/samples/new/mediaexample.wma");
                    var sound:Sound = new Sound();
                    var soundChannel:SoundChannel = sound.play();
    Even though Flex doesn't play wma's there is no error information or null objects anywhere.  Everthings seems to be fine to flex, I can even register for progress events and see the wma being loaded.
    Just to see how far this goes, I loaded a gif instead of an audio file and the same thing happened.  Progress went fine with no errors of any kind even though I registered for every listed event.  As expected though, no sound played from the gif file.
    What is the recommended way for checking if a file is not playable?

    I'm looking more for an "is it playable" value (since it might be an FLA or FLV as well).
    Even a meaningful length value would work (for some reason duration is set to a value even when loading a gif file - not sure what it means for a GIF to have a length of 96 milliseconds).
    For now I'll have to filter on extension as you mentioned.

  • How to know when series items gets changed in the bubble series

    Hi,
    I want to trace when the data inside the series data provoder gets changed. how ?
    Regards,
    Arjun.

    This works for me
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
         <mx:Script>
              <![CDATA[
                   import mx.collections.ArrayCollection;
                   import mx.events.CollectionEvent;
                   [Bindable]
                   public var expenses:ArrayCollection = new ArrayCollection([
                        {Month:"Jan", Profit:2000, Expenses:120, Amount:45},
                        {Month:"Feb", Profit:1000, Expenses:200, Amount:60},
                        {Month:"Mar", Profit:1500, Expenses:500, Amount:30}
                   public var myArray:Array=[{Month:"Mar", Profit:1500, Expenses:500, Amount:30}];
                   private function init():void{
                        expenses.addEventListener(CollectionEvent.COLLECTION_CHANGE,myFunction);
                   private function myFunction(e:CollectionEvent):void{
                        trace("I was changed");
              ]]>
         </mx:Script>
         <mx:Button label="add something" click="expenses.addItem(myArray)" />
    </mx:Application>

  • Apple please let us know when can we get factory unlocked iPhone 6

    Thanks
    Sharath

    what used to be the contract free Tmobile iPhone 6/6 plus - is now listed on the Apple web site as
    Unlocked and Contract Free
    a couple of caveats
    1) you have to buy it from Apple - if you buy a phone from Tmobile it will be locked to Tmobile - same thing might happen if you activate the phone with the Tmobile sim that comes with it from Apple
    2) LTE may not work in all counties - depends on LTE band used by a country and those supported by the US Tmobile phone (about 20 i believe)
    3) Warranty of iPhone is only valid in country of purchase ( EU is considered 1 country for warranty purposes) - so if you are not from the US and you need warranty support you would have to take the phone back to the US (or send it to someone in the US to send to Apple) - also Apple will only send the repaired phone back to a US address so if you sent it to someone they would have to get the repaired phone and send it back to you

  • I just bought the the new ipod touch 5g, does anyone know when will i get it ?

    i was just wondering.

    Sorry guys! I had a missunderstanding! But calm down. The "pre-order" button has been replaced with a "buy now" button on apple.com. (As of 3:45 PM, October 1) This is a sign that the iPods will begin to ship very soon. Keep an eye out for an email from apple!
    Take care!
    -59Ballons

  • How can a class be notified when an open file is modified externaly ?

    Hi!
    Can a class that open a File be notified when that file is modified by another program ? If yes how ?
    Thanks!

    I don't know that any operating system provides facilities to hook into the filestore this way (whatever language you're programming in). Probably the best you can do is to check the last modified time periodically.

Maybe you are looking for

  • Problem to add Icon to menu option in Oracle forms

    Hello experts,                       i am using Oracle fussion middleware 11.1.2 (oracle forms 11g) at windows 7. I am trying to make mu custom menu module with Icon images in oracle forms.I have done set property palette with Icon in Menu =Yes Icon

  • Having trouble with DV NTSC export file for Pro Tools.

    Pro Tools only takes NTSC format video. For some reason every single DV NTSC file that has been exported freezes in a certain spot and in other portions tends to flicker. I'm not so sure as to why that is. I tried exporting it through the QuickTime M

  • PhotoShop Elements 9 Edit will not open.

    After opening 2 or 3 images in Elements 9 edit a dialog box will come up and say "Elements is already running but is not responding close the Elements process or restart your system". I do not see where I can close the running Elements process. I hav

  • Syslog on Cisco Wireless Controller

    Hi everyone I have question about syslog on wireless controller. I need to know what is information in the syslog from controller. I had read paper in the community some siad it has not much in the syslog but it has not detial what is the information

  • Link to multiple plug-in windows

    Hi all Is there a way to set the linking feature up so that more than one plug-in window updates its contents when you switch channels? Say I have a Noise Gate and a Compressor on each channel - when I switch channel I want the two open plug in windo