Please help to find out whether a file was changed

Dear all,
I have a directory with different files, each file can be changed, how can I trigger the changes in a file and promt the user to update the document.
Something like out sync.
I think it could be a thred, which check the size of the file each five seconds for example. But I have seen programms, which did it immediately, as the used a hook or something like that, without any delay.
What is the common approach in java for this case?
Thanks in advance.

If I will use this method, should I put it in thread?
Or there is a better method to check for changes?Using multithreading or not has nothing to do with "checking whether a file has been modified." You need to break down your problem into small, independent pieces.
* You want to know if a file has been modified. We briefly discussed that.
* You want to perform some task every five seconds. This has NOTHING to do with the above. You perform a periodic task using java.util.Timer and TimerTask.
Since those two things are completely independent of each other, get each one working on its own, without regard for the other. THEN, and only then, combine them into "check for file modification every 5 seconds."

Similar Messages

  • HT1933 I make a purhase on March 6 at 11:33 Order number MHOXX3TK9J for $1.99 and my credit card was charged $20.00 can you please help me find out why this happened

    I made a purchase on itunes on March 6 at 11:33 order umber MHOXX3TK9J for 1.99 and my credit card was charged $20.00 please help me find out why this happened.

    Contact iTunes support at the link below.
    https://ssl.apple.com/emea/support/itunes/contact.html

  • Please help to find out asmlib kernel driver ?

    Hello everyone, please help to find out correct asmlib kernel driver ?
    rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm
    error: Failed dependencies:
    oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.4-1.el5.x86_64
    My kernel version is:
    uname -a
    Linux 2.6.18-238.el5xen #1 SMP Tue Jan 4 16:15:36 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
    Thank you.

    user12144220 wrote:
    Hello everyone, please help to find out correct asmlib kernel driver ?
    rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm
    error: Failed dependencies:
    oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.4-1.el5.x86_64
    My kernel version is:
    uname -a
    Linux 2.6.18-238.el5xen #1 SMP Tue Jan 4 16:15:36 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
    Thank you.uname -rm
    you can find the exact oracleasmlib for your version
    eg:- my system Intel IA64 Architecture
    Library and Tools
    * oracleasm-support-2.1.7-1.el5.ia64.rpm
    * oracleasmlib-2.0.4-1.el5.ia64.rpm
    and then search(control +F) for  2.6.18-238.el5
    refer this link:-http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html

  • How to find out whether Oracle database was upgraded ??

    Hi,
    I need to find out whether my Oracle database was upgraded, If yes how to find out by SQL query .I know their is database_properties table, but when I try to query that it didnt gave me the output which I required.
    Like in SAP we have uvers table which keep info about the upgrade history, whether such history is avaliable in oracle ?? . Iam looking out for output which is like old database Release 9.2.0.7 and new database release 10.2.0.2.
    Whether similar such history is maintained in Oracle database.
    Awaiting for your feedback.
    Kind Regards
    Neenad

    Hi all,
    After checking all the material,I dont think prior to 10g, oracle register its earlier version.
    The views of v$version show the current version for various components and also dba_registry displays info about catlog/catproc versions.
    In 10g, you can use the following query to know the version when the database was broughtup.
    select startup_time,version,db_name from dba_hist_database_instance.
    Anways thanks to all of you.
    Kind Regards
    Neenad

  • Please help me find out my code..I am using msg ACCept and Reject

    Please anyone help me...
    I am using MSG ACCEPT and REJECT...
    but my code when I execute it...it keep show out MSG REJECT...
    Please help me...Thanks a lot....
    public class Addmission
    public static void main(String[] args) throws Exception
    char Message;
    double GPA = 3.0;
    int ATS = 60;
    int ATScore = 80;
    System.out.println("Enter your Grade Point Average");
    GPA = (char)System.in.read();
    System.out.println("Enter your Addmission Test Score");
    ATS =(char)System.in.read();
    System.in.read(); System.in.read();
         if(GPA >= 3.0 && ATS == 60)
    System.out.println("Accept");
    if(GPA <= 3.0 && ATScore == 80)
    System.out.println("Accept");
    else
    System.out.println("Reject");

    I need to do like... but my code doens't show msg "Accept" it keep going to show "REJECT"
    Could anyone help me out?
    Print the msg "Accept" if the student has any of the following:
    * A grade point average of 3.0 or above and admission test score of at least 60
    * A grade point average of below 3.0 and an admission test score of at least 80.If the student doesn't meet either of the qualification criteria, print "Reject"
    public class Addmission
    public static void main(String[] args) throws Exception
    char Message;
    double GPA = 3.0;
    int ATS = 60;
    int ATScore = 80;
    System.out.println("Enter your Grade Point Average");
    GPA = (char)System.in.read();
    System.out.println("Enter your Addmission Test Score");
    ATS =(char)System.in.read();
    System.in.read(); System.in.read();
    if(GPA >= 3.0 && ATS == 60)
    System.out.println("Accept");
    if(GPA <= 3.0 && ATScore == 80)
    System.out.println("Accept");
    else
    System.out.println("Reject");

  • Random file on hard drive, please help me find out what it is

    Hi all,
    I have had this file sitting on my hard drive, when you click and open from hard drive icon there is a file sitting there called mds-crash-state. If i try to delete it it says enter my user password, so ididnt thinking it could be important. Anyone able to shed some light on this and if i can actually delete it without killing my machine?

    Go and trash it. The 'mds-crash-state' file may be created if the Metadata Server crashed or was unexpectedly closed during the indexing process. The presence of this file can prevent Spotlight from indexing the volume in the future.
    -Bmer
    Mac Owners Support Group
    Join Us @ MacOSG.com
    ITMS: MacOSG Podcast
     An Apple User Group 

  • Can someone please please help me find my iphone? it was stolen out of an airstream while I was sleeping

    find my iphone located it and I saw the notification a few minutes too late. Does anyone know how to get my phone back to me? I have thousands of pictures that i need for promotion and business, and I am willing to do whatever it takes to have my phone returned to me! Thanks for any help or suggestions.

    What To Do If Your iDevice or Computer Is Lost Or Stolen
    If your Mac, iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should do in advance - before you lose it or it's stolen - and some things to do after the fact. Here are some suggestions:
    Reporting a lost or stolen Apple product
    AT&T, Sprint, and Verizon can help find stolen phones/tablets
    What-To-Do-When-Iphone-Is-Stolen
    Lost or Stolen iPhone? Here’s What to do.
    6 Ways to Track and Recover Your Lost/Stolen iPhone
    Find My iPhone
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
    Find My iPhone
    Setup your iDevice on MobileMe
    OS X Lion- About Find My Mac
    How To Set Up Free Find Your iPhone (Even on Unsupported Devices)
    Third-party solutions for computers:
    VUWER 1.5.4
    Sneaky ******* 0.2.0
    Undercover 4.7
    LoJack for Laptops Premium Mac
    STEM 2.1
    MacPhoneHome 3.5

  • I can't remember my secret questions answer and I am so confused I tried all the ways but it's not Woking can anyone please help to find out how

    I really appreciate your help, it's really urgent need?

    The Three Best Alternatives for Security Questions and Rescue Mail
        1. Use Apple's Express Lane.
              Go to https://expresslane.apple.com ; click 'See all products and services' at the
              bottom of the page. In the next page click 'More Products and Services, then
              'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
              ID security questions' and click 'Continue'. Please be patient waiting for the return
              phone call. It will come in time depending on how heavily the servers are being hit.
         2.  Call Apple Support in your country: Customer Service: Contacting Apple for support or
              Apple ID- Contacting Apple for help with Apple ID account security. Ask to speak to
              Account Security.
         3.  Rescue email address and how to reset Apple ID security questions.
    How to Manage your Apple ID: Manage My Apple ID

  • TS2446 please help to find out this issue sorted out ..

    i did all this changes .. and i followed all the istructions , but i still have the same problem when i click to buy any new item from itune store .. etc
    i got a message " your apple ID has been disabled , please contact iTune support .
    hope to hear from you to sort out this issue as soon as possible .  thanks

    These are user-to-user forums, you can contact iTunes support here : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • Please Help to find out my Stolen Iphone

    Hi i Lost my Iphone 1 day ago before I installed Find my Iphone now I`m trying to find my Iphone by Find my Iphone it aways "off"
    Here`s my Serial number: 67******A4S please tell me what to do? please reply ASAP.
    <Edited By Host>

    You should not post your serial number and I've asked the Hosts to remove it.
    You can't locate your phone if you did not enable the 'Find My Phone' app. In addition the phone would have to be on, not wiped, and able to connect to a network. The serial number will not enable you to locate your phone.

  • PLEASE HELP CANT FIND OUT!!!!!!!!!!!!!(ipod video)

    can i put stuff on my ipod from a different computer. Like i have one pc where i put all my music on. But i want to put dvds that i own on it to. So my other pc has a dvd drive. is there some way i can make this work?

    See if this helps;
    http://docs.info.apple.com/article.html?artnum=61675
    Cheers!
    -Bryan

  • I had a new ipod touch5 when I updated it to iOS 7.1.1 there is no facetime in the settings. What is wrong? Please help me find out and get the Facetime back.

    I updated to ios 7.1.1 then eventually the facetime was gone

    Have you updated it wirelessly or via iTunes? Have you an manual IPSW (firmware file) to update?
    Had you FaceTime before?
    It is maybe turned off in Settings --> General --> Restrictions?

  • Can someone please help me find out my security question answers ?

    I can not remember the answers to my security questions and I go to send the answers to my email and it does not work

    If the email hasn't arrived after a few hours and isn't in a spam filter, you need to contact Apple to get the questions reset. Click here, phone them, and ask for the Account Security team, or fill out and submit this form.
    (93436)

  • Can you please help me find out...

    Hi. How can I drag and drop music into a iPod from a computer and get it to work? My computer will not work with iTunes, so I need to know this... Thanks.

    You should run some diagnostics/repair tools and get it sorted.

  • Can someone please help me find out how to retrieve documents from icloud?

    Is there any way to retrieve my documents after erasing someone else's iCloud from my iPad?

    Sign back into your own iCloud account. Any documents that were in your iCloud account when you setup someone else's account on your device will still be there when you sign back in to your account.

Maybe you are looking for

  • How can I display a letter grade in my gridview after calculating percentage into a hidden field in Visual Studio?

    For school I am working on an app using C# in visual studio that allows a student to enter their name, the number of points they earned and the points possible. When they click a submit button, the grade percentage is calculated in a hidden field and

  • Can't update my iPod touch 3rd gen

    So I have my 3rd gen iPod touch and i have tried to update it several times with errors telling me that iTunes timed out or with the 3091 error code (i think its the 3091 its the highest error code with 3000) and i have redownloaded itunes rebooted m

  • Problem while refreshing the cube from excel

    I am trying to refresh the excel file(Cube from excel).  But i can able to refresh the same cube in server. But users facing this problem. The following error coming  I was working fine till yesterday.  Please suggest me...  Sudhan

  • Why can't I send or share photos from my iPhone?

    after update to ios 7.0.2 (iphone 5) i cant send/share any photos which are in camera roll with facebook or any app. when an app try to access camera roll same notice seen "this app does not have access to your photos or videos, you can enable access

  • RFC (or) IDOC to transfer data

    Hi! All How to transfer the data from server to another? i.e. I'm having two different R3 server, need to transfer data from one server to another. Which option is efficient? Is there any possibilities to use RFC. Kindly guide me friends. Thanks and