WatchService WatchKey.cancel() is really forever ?

I am using java 8 on linux ubuntu 12.04 following the guidelines Watching a Directory for Changes (The Java™ Tutorials > Essential Classes > Basic I/O)
This works but I notice that once I cancel a watchkey with watchkey.cancel() , I seem to be unable to reenable it again. So I can never watch a directory after I have cancelled the corresponding watchkey (even after reboot ) ?
The API Doc says that " Once cancelled, a watch key remains forever invalid."
What does "forever" mean ? There must be a way to re-watch a dir after the key has been cancelled.
Thanks for your help.

Registering recursively will work as Sotirios has indicated. This effectively registers each directory/sub-directory that currently exists.
You can alternatively import and use *com.sun.nio.file.ExtendedWatchEventModifier.FILE_TREE* as in:
dir.register(watcher, standardEventsArray, ExtendedWatchEventModifier.FILE_TREE);
This will watch the entire sub-tree for change AND account for added directories and sub-directories.
Otherwise you will have to monitor for any new directories/sub-directories and register them also. There can also be an issue with deleting parts of the directory hierarchy since each registered directory has a handle watching it so the (lowest) sub-directories need to be removed first when deleting parts of the structure.

Similar Messages

  • Cancel Membership, really?

    When you make it difficult to cancel a membership during the 30-day cancellation period, you lose a lot of credibility. It should be a click, a confimation and and exit survey... period.

    Hi Jarrodhogue,
    Welcome to Adobe Forum,
    You can cancel the Adobe CC with a full refund within 30 days of purchase.
    http://helpx.adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting- creative-cloud.html
    Please check the above for all options to cancel.
    Regards,
    Rajshree

  • JDK7 java.nio.file.WatchService - not flexible enough?

    Hi,
    is it indeed impossible to add/remove watched directories when needed by using a single WatchService?
    My case:
    - I'm creating a file browser using Java 7 (jdk build 79) The user (the file browser) navigates to a dir and starts listening to file-related events (like modified, created, deleted) on this dir. Once the user navigates to another dir the file browser has to stop listening to the old dir and start listening to the new one for events.
    Impossible because:
    - Stopping watching the folder thru WatchKey.cancel() doesn't work when you haven't received any notifications from the corresponding directory yet and the user navigates to another folder. In this case the WatchKey is null and I can't use it to stop listening to the (already old) folder by calling WatchKey.cancel().
    In this case the only thing left is closing the WatchService altogether and starting a new WatchService each time. Is this what a developer is supposed to do?
    And obviously the third way to stop listening for a directory (the WatchService stops listening to deleted directories) - doesn't cut it either.
    Edited: corrected typo "WatchKeyEvent" with "WatchKey"

    You can register additional directories or cancel the key for an existing registration while using a WatchService.
    +...just cancel the key and register the new directory, which will give you a new key.+
    Thanks,
    The problem is, the WatchKey is almost always null because: one gets the WatchKey not when registering the dir listener, but after receiving the first dir event (create, delete, modified), thus, not here:
    try {
         dir.register(service, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
    } catch(Exception exc) {
         return;
    }But here:
    try {
         key = service.poll(300L, TimeUnit.MILLISECONDS);
    } catch (InterruptedException x) {
         break;
    }Thus, I can't unregister this dir if there hasn't been any event for this dir yet, because in this case the WatchKey is null and I can't use it's cancel() method (and no, using take() instead of poll() doesn't help either).
    Thus in this case I'm left with the other 2 ways to unregister a directory: stop the service altogether (not good) or when directory deleted (useless).
    Again, I'd like to stress out that I mean situations when the WatchKey is null, which is a game changer, and in my case, the user browses thru directories, so this happens a lot.
    Edit:
    Quick example: user is in /home/fox/Documents, he clicks "up" button several times to get to the root dir "/", thus the file browser ends up with 3 directories being listened: (1) "/", (2) "/home", (3) "/home/fox", since he navigated quickly he did nothing to the "in between directories" (/home and /home/fox) thus their WatchKeys are still null and thus I can't unregister these dirs through their WatchKey.cancel() mechanism. I hope I made myself clear.

  • TC Prerparing Backup FOREVER

    well not really forever, but it has been 3 days since the system is "Preparing Backup" and seems to be stuck at 99%.... what to do? thanks guys

    Try go to the "Go" menu in Finder - and select "Connect to server" (CMD + K) - and enter the name/adress - or better for most choose "Browse".
    Then your Time Capsule should hopefully show up.
    Select it, to make the connection to the TM. This might help, but not always. However, in some situations it's really a matter of getting the first connection to work.

  • C6-00 Cancel Sending A Text

    I just got a new C6 00 and I noticed there isn't an option to cancel sending a text if you click "Send" by accident. I've been trying to figure it out, but to no avail. Any suggestions?
    Solved!
    Go to Solution.

    Thanks for taking the time to answer guys! Angie, I hear what you're saying But I just feel that it would be a teeeenie bit inconvenient. Dump, I completely agree with you. I love my phone, but the simplest things like smileys, conversations and a cancel button really, really get to me. Anyway, thanks for trying to help guys. Guess I'm going to have to be more careful.

  • Trying to get broadband connected...

    Hello,
    I'm writing this in the hope that someone can help me. I placed an order for a combined TV, phone and broadband on 14th May and was given a connection date of 31st May between 8am and 1pm. I took the day off work and at 10 am 2 BT openreach vans parked outside my house. I went down to ask if either of them were there to connect me and they said neither of them was. A courier arrived at this point with all the equipment and I was advised to call and check on the engineer status. I called at 1pm to say nobody had arrived and they apologised, offered a £10 compensation and said that the IT system was down for the engineers so they couldn't access the log but guaranteed that an engineer would attend later that day before 5pm.
    I called back at 5 as nobody had arrived and was told that the engineer had reported it as being unable to gain access due to customer not being present. I was absolutely livid at hearing this and demanded that an engineer attend that evening only to be told that they'd finished work for the weekend and Tue 4th June would be the earliest. I asked to submit a formal complaint and the manager that I spoke to in the technical department said that he would note my dissatisfaction and email my partner, whose name the account is in, with confirmation of what they were doing to resolve the issue as well as details of his name, department and position along with the same info on the other operators that I had spoken to. No such email was received but we did get a text to say that we would be connected on Thursday 6th June!
    My partner called on Monday to ask why she'd not received the email and to check exactly when we were getting connected as we would again have to take time off work. She was told that the text was wrong and that it would indeed be Tue 4th June. She managed to arrange to work from home that day at the last minute and an engineer duly attended but only activated the phone line and, when asked about the internet, said it was "nothing to do with him".
    I called BT that afternoon to clarify what was happening with the broadband and was told to not worry, that the service would go live within 12 hours of the engineer visit. I waited the 12 hours and called to check, only to be told that the service had been cancelled by someone in an administrative error and that it would be 2-3 weeks before we could expect connection. I was once again very angry at this news and asked to once again submit a formal complaint. I was told the complaints team was closed and would have to call back the following day.
    On Wed 5th June, I called and asked for an explanation as to why the order had been cancelled. I received no explanation and asked to speak to the manager. They said that the manager was on another call and would call me back ASAP. I waited 45 mins and called back, they reiterated that a manager would be calling me ASAP. I waited another 45 mins and still no call. I called back again and spoke with a guy called Stephen in technical, who gave me his personal assurance that the service would be connected within 48 hours of the call. He said he was taking personal responsibility for the case and that I had no further need to contact them. I took him at his word and kept a check on the homehub router for changes.
    On the Thursday 6th June, the 'broadband' light went from flashing orange to constant red which, according to the set-up guide, meant that the broadband was active but the username was incorrect. I called to check this with technical and was told that this was incorrect and that red just meant that the broadband line was inactive. He checked further and said the order was still showing as cancelled which again caused me to get a little angry over the repeated misinformation and having to make so many calls regarding the situation. I again asked to make a complaint and again was told the department was closed.
    I called again on Friday 7th June, after 12 which meant the 48 hours had elapsed and therefore the operator, Stephen, had not held to his promise to personally oversee the case. I asked to be put through to cancellations, explained the situation for about the 15th time and asked for all the monies that we had paid BT so far to be refunded, along with the £45 that we had spent on BT public WiFi since the 14th May and also compensation to cover my loss of earnings in taking the day off on Friday 31st unnecessarily as well as the bills that we had run up on our mobiles contacting them regarding the situation. They apologised again and put me through to someone in the technical Dept that guaranteed me that they would speak with openreach and get someone out that day. They also took my mobile number and said they would call me back at 4pm with an update. 4pm came and went with no call back so I called once more and requested a refund and compensation. They said that the technical team were definitely acting on the situation and if I held on a little longer, they would make sure the lady I had spoken to would call me. Needless to say, I got no call.
    I called again on Saturday 8th June and spoke with someone called Darren in customer retention who said he was sorry that I'd been treated so poorly and gave me a number to call direct on Monday morning to speak with someone regarding the matter. He said that they needed one more chance to put it right.
    I called on Monday 10th June and spoke with a customer options Dept operator who said that the order was still showing as cancelled and that he would have to place a fresh order which would take 2-3 weeks. I had lost patience by this point and asked to be put through to cancellations, they listened to the story once more and put me through to another Dept where an operator reiterated that they could process the connection in 48 hours. I said that was no longer acceptable as I'd been assured twice the previous week of this and it hadn't transpired. He then said his manager might be able to get it done that day and put me through to him. His manager said that 2-3 working days was the quickest that it could be done. 
    I asked to go back to cancellations, reiterated the refund and compensation I expected and was told that I would have to speak with billing about it. I got put through to billing and the guy I spoke to took all the security details but refused to go further unless I told him the payment method used by my partner, saying that the bank name and the fact that it was a debit card wasn't enough. I took his number and got my partner to call but it just rings out at the number he gave us. I called back again and spoke with cancellations. The girl I spoke to there said that she would personally try and sort it out for me. She went off the phone to speak with the various departments and came back saying that the order was still open and that the service should be getting connected in the next 48 hours. She said that she'd call me tomorrow to check if it was connected and gave me a number fro openreach saying that usually it would only be BT operators that could speak to them but this was a public number and that someone might help me out.
    I called openreach and the operator said that she dealt with fallen cable poles and holes in the street and that she had no way of helping me and advised me to speak to BT - sigh!
    Here's what I think is reasonable - that someone at BT could speak with someone at openreach and, given that the engineers are just as responsible for the delay as the BT operators, arrange to get me connected either today or tommorow. If this can't be done, I think that I should reasonable expect BT to:
    refund all the monies paid to them for the package and the up-front line rental
    refund the £45 that we've spent on the public BT wifi that should have been free as we had signed a contract with them back on the 14th May
    pay for the costs of our calls to them through our mobile providers
    compensate me for loss of earnings for the day that I took off to wait on an openreach engineer who fraudulently claimed that I wasn't home
    I think that, given the level of stress that this has put both me and my partner under (we both need to work from home and this has proven very difficult for us as we live in a rural area and have to rely on the public wifi otherwise), coupled with the amount of time that I've spent trying to sort it our, that this is the least we should expect.
    One of the biggest issues with cancelling the order for me is that there are simply no alternatives in the area. For our postcode of PH15 2AA, I've been told by Talk Talk, SKY and Virgin Media that they can't provide the service as BT charge them £17 a month to utilise the infrastructure therefore they don't offer their services in my area. This would seem then, that BT have a monopoly on the broadban for the area which I understood to be illegal under UK trading legislation.
    Does anyone on this forum have any advice at all for me or know of where I can find out alternative ISP's? Uswitch and all the other checkers show that there are a number of ISP's in the area but when I contact them directly they all say the same thing...
    Please help - I'm starting to go a little crazy with all this! (I know that some people are reporting that they have waited weeks for connection but I simply can't accept that...)

    Well, now we're back to square one - we spent another hour on the phone to BT yesterday and the best they could do was to restart the whole order process from scratch as the orders team had no record of an order ever being placed. I spent yet another frustrating, fractured 20 minutes initially trying to get some sense out of the Indian call centre and the guy that I spoke to in cancellations himself admitted that it was a nightmare trying to get a straight answer out of them. This follows another person in cancellations admitting that they got just as frustrated with the other departments being poorly organised and hard to communicate with. I'd just like to underline the fact that I have no problem with BT outsourcing their call centres to other countries and no problem with people from those countries being tasked with the admin of the order process or customer service. I previously had experience of using the Dutch technical team that ran Be Unlimited's service and they were fantastic - great communicators, well-organised and able to rectify my problem within hours.
    The fact is that everyone that I've spoken to in either the orders department or technical department rattles out the same spiel that they must be reading off some card in front of them like a robot. They don't actually listen to what I'm telling them and they obviously have no form of administrative infrastructure that allows them to work efficiently. I have to go through the same process every time, explaining the whole story from the beginning and being given the same empty platitudes and promises every time by yet another office drone. The inter-departmental communications are non-existent and BT's whole systematic processes are abysmal. The whole corporation needs re-organising from the ground up and surely can't continue to be a profitable business for much longer if the volume of customer complaints and despairing posts on this very forum are anything to go by.
    To reiterate:
    Order placed 14th May, connection date 31st May - engineer to attend between 8 am and 1 pm 
    31st May, courier delivers hardware, engineers parked outside my house for 3 hours, neither of them assigned to the job, call BT after time window of visit expires and am assured an engineer will attend. Call back after 5 and told that the engineer claimed he couldn't gain entry and all engineers are finished for the day until Monday (despite an engineer attending my work which is located 5 doors down to fix our business broadband connection on a Saturday, less than 3 hours after I called). Make formal complaint and am assured engineer will attend on 4th June and internet will be connected same day
    Engineer attends 4th June, claims broadband nothing to do with him, call BT and assured that service will activate later that day, service does not commence and am told the order appears to be cancelled when I call to check. Make formal complaint and am told someone will call me next day, so provide my number
    5th June, no call so phone to check/complain - am told manager will call back ASAP. Wait 45 mins, no call. Call back, am reassured that someone will call. Wait 45 mins, no call. Call back again, speak to 'Steven' in orders who apologises and tells me he's going to personally oversee a fast-track of the order that will see it connected in 48 hours and that I have no further need to call them.
    Call on 6th June after a change on the homehub router lights to check if this is the service being activated. Am told that the order is still showing as cancelled. Make another formal complaint and am assured that someone will call me back next day.
    7th June, nobody calls and the 48-hour window expires. Call to check on status/complain and I'm told the order is still cancelled by orders dept. Ask to be put through to cancellations to get the service cancelled and get a refund, am told that order has not been cancelled. I'm put through to 'senior manager' in order department who guarantees connection that day and that she herself will call at 4pm to confirm. 4pm comes and goes - no call. Call BT to check/complain/cancel order - speak with cancellations who ask for more time and say they will make sure the woman from orders dept calls me. Wait for rest of night - no call.
    8th June, phone and speak to Darren in cancellations, he asks that I give them one more chance to fix things and gives me the customer options direct number to call on Mon 10th June
    Call BT on Mon 10th June, am told that the order has been cancelled and that they will have to place new order. Try to cancel and get refund, once again talked into giving them 48 hours to connect the service. Spend 4.5 hours on phone trying to get answer to why the service has been delayed/order cancelled. Start to receive random calls on landline, am told that this is the engineer at the junction box testing the line and that he's found a fault which is why the connection has been delayed. Told that service will definitely be activated within 48 hours. I'm also told that someone will call on 11th June with an update.
    11th June - no call
    Call BT on 12th June to check on connection, told again that order has been cancelled and really start to get angry now. Make another formal complaint and am told that specialist team has been assigned to investigate the case and they will call the next day to let me know what's happening.
    13th June - no call. Call BT to check/complain/attempt to cancel and get stuck in the usual run-around with Indian call centre. Don't get anywhere but am one again assured that specialist team are on the case and they'll call me the next day but that they've finished for the day so I can't speak to them.
    14th June - no call. Call BT to check/complain/attempt cancellation/make empty threats and am informed that they have no record of an order ever being placed. I freak out and get slightly abusive with operator. Get through to cancellations and speak with 'Steve'. He spends a long time talking to orders dept on my behalf and comes back to say that he will have to start order process from scratch all over again which will take 5 working days. Make another formal complaint. I ask him to check on previous complaint references, he does and says "yes, there's a note here for someone to call you.......today". I ask him what is the point of submitting formal complaints when they aren't even looked at and he tells me it's a 10-day process - I ask why the complaint that I registered on 31st May hasn't been dealt with as that's more than10 days and he has no answer.
    Now if you can tell me that this is in any way a reasonable way to treat someone who is paying for you to provide a service then we live on different planets. There is no way that the customer care team can rectify this other than serious compensation which will have to be a **bleep** sight better than the 2 months free line rental that we've been offered so far. I have never had a worse experience as a customer anywhere, with any company. I've travelled in the 3rd world and even there, the utilities companies purvey a vastly superior service than this supposedly flagship company of British technology and communications. I asked an operator if he thought that it was ironic that a telecommunications company couldn't get it together to make a phone call to me after more than 10 promises to do so, unsurprisingly he didn't get it. BT stands for something but my brain lacks the energy to come up with an acronym that is suitably abusive. 

  • How can I hold data stored in an object?

    Hi everyone!
    I have a problem with a Java-Program that I am trying to write for university.
    The program is the following:
    import java.io.*;
    public class Ergasia4
    {     public static void main (String args[])throws IOException
         {     int i,epilogi;
              boolean first1=true, first2=true, first3=true, first4=true;
              Ptisi A3510,A3511,A3512,A3513;
              A3510 = new Ptisi();
              A3511 = new Ptisi();
              A3512 = new Ptisi();
              A3513 = new Ptisi();
              i=0;
              for(;;)
              {     do     
                   {     if (i==1) System.out.println ("Lathos epilogi");
                        System.out.println ("EPILOGI PTISIS");
                        System.out.println ("1. Ptisi A3510, ATH-SKG");
                        System.out.println ("2. Ptisi A3511, SKG-ATH");
                        System.out.println ("3. Ptisi A3512, ATH-SKG");
                        System.out.println ("4. Ptisi A3513, SKG-ATH");
                        System.out.println ("0. Exodos");
                        System.out.print ("Epilogi: ");
                        epilogi=my.readInt();
                        System.out.println ();
                        i=1;
                   while ((epilogi!=0)&&(epilogi!=1)&&(epilogi!=2)&&(epilogi!=3)&&(epilogi!=4));
                   if (epilogi==0) break;
                   else
                   {     switch (epilogi)
                        {     case 1: System.out.println("Ptisi A3510, ATH-SKG"); A3510.menu(first1); break;
                             case 2: System.out.println("Ptisi A3511, SKG-ATH"); A3511.menu(first2); break;
                             case 3: System.out.println("Ptisi A3512, ATH-SKG"); A3512.menu(first3); break;
                             case 4: System.out.println("Ptisi A3513, SKG-ATH"); A3513.menu(first4); break;
                             default : break;
    class Ptisi
    {     int epilogi,i;
         private boolean availiability[];
         private long telephones[];
         public void menu (boolean a) throws IOException     
         {     if (a==true) arxikopoiisi(availiability);
              a=false;
              for (;;)
              {     do
                   {     if (i==1) System.out.println ("Lathos epilogi");
                        System.out.println ("1. Kratisi thesewn");
                        System.out.println ("2. Akyrwsi kratisis");
                        System.out.println ("3. Emfanisi sygentrwtikwn stoixeiwn");
                        System.out.println ("0. Exodos");
                        System.out.print ("Epilogi: ");
                        epilogi=my.readInt();
                        System.out.println ();
                        i=1;
                   while ((epilogi!=0)&&(epilogi!=1)&&(epilogi!=2)&&(epilogi!=3));
                   if (epilogi==1)
                   {     kratisi(availiability,telephones);
                        i=0;
                   else if (epilogi==2)
                   {     akyrwsi(availiability,telephones);
                        i=0;
                   else if (epilogi==3)
                   {     emfanisi(availiability);
                        i=0;
                   else if (epilogi==0) break;
         public static void kratisi (boolean availiability[],long telephones[]) throws IOException
         {     int theseis;
              long tilefwno;
              int j,i=0,x=-1;
              boolean k=false;
              i=0;
              do
              {     if (i==1) System.out.println ("Arithmos ektos oriwn");
                   System.out.println ("Poses theseis theleis na kratiseis ?");
                   System.out.print ("Theseis: ");     
                   theseis=my.readInt ();
                   System.out.println ();
                   i=1;
              while ((theseis<0)||(theseis>36));
              for (i=0;i<availiability.length;i++)
              {     if (availiability==true)
                   {     for (j=i;j<=(i+theseis);j++)
                        {     if (availiability[j]==false)
                             {     break;
                             else if (j==(i+theseis))
                             {     x=i;
                                  break;
                   if (x>-1) break;
              if (x>-1);
              {     i=0;
                   do
                   {     if (i==1) System.out.println ("Lathos arithmos tilefwnou");
                        System.out.println ("Eisagete ton arithmo tilefwnou");
                        System.out.print ("Arithmos: ");     
                        tilefwno=my.readInt ();
                        System.out.println ();
                        i=1;
                   while (tilefwno<0);
              if (x>-1)
              {     for (i=x;i<(x+theseis);i++)
                   {     availiability[i]=false; telephones[i]=tilefwno;
                   System.out.println("I kratisi "+theseis+" thesewn egine epityxws");
                   System.out.println();
              else System.out.println("Den yparxoun "+theseis+" diathesimes synexomenes theseis");
         public static void akyrwsi (boolean availiability[],long telephones[]) throws IOException
         {     int i,thesi,plithos,x=-1;
              i=0;
              do
              {     if (i==1) System.out.println ("Arithmos ektos oriwn");
                   System.out.println ("Dwse tin prwti thesi tis akyrwsis");
                   System.out.print ("Prwti thesi: ");     
                   thesi=my.readInt ();
                   i=1;
              while ((thesi<0)||(thesi>36));
              i=0;
              do
              {     if (i==1) System.out.println ("Arithmos ektos oriwn");
                   System.out.println ("Poses theseis theleis na akyrwseis ?");
                   System.out.print ("Prwti thesi: "+thesi+" Theseis: ");     
                   plithos=my.readInt ();
                   System.out.println ();
                   i=1;
              while ((plithos<0)||(plithos>36-thesi));
              for (i=thesi;i<=(thesi+plithos-1);i++)
              {     if (availiability[i]==true)
                   {     break;
                   else if (i==(thesi+plithos-1))
                   {     x=i;
                        break;
              if (x>-1)
              {     for (i=thesi;i<(thesi+plithos);i++)
                   {     availiability[i]=true; telephones[i]=0;
                   System.out.println ("I akyrwsi egine epityxws");
                   System.out.println ();
              else
              {     System.out.println ("I epilegmenes theseis einai kenes");
         public static void emfanisi (boolean availiability []) throws IOException
         {     char seatmap[][]=new char [10][10];
              int k,i,j,plirotita=0;
              for (i=0;i<availiability.length;i++)
              {     if (availiability[i]==false) plirotita++;
              plirotita=plirotita*100/36;
              System.out.println("Plirotita :"+plirotita+"%");
              i=0;               
              for (j=0;j<4;j++)
              {     for (k=0;k<9;k++)
                   {     if (availiability[i]==false) seatmap[j][k]='X';
                        else seatmap[j][k]='_';
                        i++;
              for (j=0;j<4;j++)
              {     for (k=0;k<9;k++)
                   {     System.out.print (seatmap[j][k]+" ");
                        if ((k+1)%4==0) System.out.println();
         public void arxikopoiisi (boolean availiability[])
         {     int i;
              for (i=0;i<availiability.length;i++)
              {     availiability[i]=true;
    So, this program is supposed to simulate an airline's reservations system.
    There are four flights, numbered 510-513, each with an aircraft of 36 seats (9 rows of 4 seats each).
    On class "Ptisi" there are 5 classes, which do the following:
    a. class "menu" shows a menu, where the user can select if he wants to make a reservation, a cancellation or if he wants to view the seat map.
    b. class "kratisi" performs a reservation.
    c. class "akyrwsi" performs a cancellation.
    d. class "emfanisi" shows the seat map.
    e. class "arxikopoiisi" initializes the array "availability[36], making it all "true".
    Class "Ergasia4" is supposed to create four objects, A3510-A3513, for each of the 4 flights. Then there is a menu for the user to select between the four flights. Depending on the choice of the user, the program must show the menu for one of the four available flights, as programmed on class "Ptisi" and then perform the action(s) requested by the user. On both menus, "0" exits.
    So, what is my problem?
    Well, when I run the program, if I select a flight, then all actions are performed without a problem, I can make a reservation, cancel some seats or view the seat map. The problem comes when I exit a flight, then work on another flight and then return on the original one. All seat reservations are gone!
    Can anybody help me solve this problem?
    Thank you in advance,
    philimonas
    P.S. If you think it would be helpful, I can omit the code of the functions that work!

    Thanks for your help, doremifasollatido!!
    So, the code now looks as follows (I am posting a "smaller" version of it)
    import java.io.*;
    public class Ergasia4
    {     public static void main (String args[])throws IOException
         {     int epilogi;
              boolean secondTry;
              Ptisi A3510,A3511,A3512,A3513;
              A3510 = new Ptisi();
              A3511 = new Ptisi();
              A3512 = new Ptisi();
              A3513 = new Ptisi();
              secondTry=false;
              for(;;)
              {     do     
                   {     if (secondTry)
                        {     System.out.println ("Lathos epilogi");
                        System.out.println ("EPILOGI PTISIS");
                        System.out.println ("1. Ptisi A3510, ATH-SKG");
                        System.out.println ("2. Ptisi A3511, SKG-ATH");
                        System.out.println ("3. Ptisi A3512, ATH-SKG");
                        System.out.println ("4. Ptisi A3513, SKG-ATH");
                        System.out.println ("0. Exodos");
                        System.out.print ("Epilogi: ");
                        epilogi=my.readInt();
                        System.out.println ();
                        secondTry=true;
                   while ((epilogi<0) || (epilogi>4));
                   if (epilogi==0) break;
                   else
                   {     switch (epilogi)
                        {     case 1:
                             {     System.out.println("Ptisi A3510, ATH-SKG");
                                  A3510.menu();
                                  secondTry=false;
                                  break;
                             case 2:
                             {     System.out.println("Ptisi A3511, SKG-ATH");
                                  A3511.menu();
                                  secondTry=false;
                                  break;
                             case 3:
                             {     System.out.println("Ptisi A3512, ATH-SKG");
                                  A3512.menu();
                                  secondTry=false;
                                  break;
                             case 4:
                             {     System.out.println("Ptisi A3513, SKG-ATH");
                                  A3513.menu();
                                  secondTry=false;
                                  break;
                             default : break;
    class Ptisi
         private boolean availability[];
         private long telephones[];
         public Ptisi()
         {     availability = new boolean[36]; // Do you do this somewhere?
                 arxikopoiisi();
         //Displays the menu for action-selection     
         public void menu () throws IOException     
         {      //Variables
                 //Shows the menu
         //Method to reserve seats
         public void kratisi () throws IOException
         {     //Variables
              //Asks the number of seats to be booked and checks for input errors          
              //Finds, if available, the first seat of the booking
              //Asks for the telephone number to be used at the booking, if a booking is to be made
                    if (x>-1);
              {     i=0;
                   do
                   {     if (i==1) System.out.println ("Lathos arithmos tilefwnou");
                        System.out.println ("Eisagete ton arithmo tilefwnou");
                        System.out.print ("Arithmos: ");     
                        tilefwno=my.readInt ();
                        System.out.println ();
                        i=1;
                   while (tilefwno<0);
              //Performs the booking, or displays an error message
                    if (x>-1)
              {     for (i=x;i<(x+theseis);i++)
                   {     availability=false; telephones[i]=tilefwno;
                   System.out.println("I kratisi "+theseis+" thesewn egine epityxws");
                   System.out.println();
              else System.out.println("Den yparxoun "+theseis+" diathesimes synexomenes theseis");
         //Method to make a cancellation
         public void akyrwsi () throws IOException
         {     //Variables
              //Asks for the first seat of the cancellation and checks for input errors
              //Asks for the total seats to be canceled and checks for input errors
              //Checks if the seats to be canceled are really booked
              //Performs the cancellation, or displays an error message
         //Method to display the % of occupancy and the seatmap
         public void emfanisi () throws IOException
         {     //Variables
              //Calculates the % of occupancy          
              //Displays of the % of occupancy
              //Creation of the seatmap
              //Display of the seatmap
    //Method to initialize the array "arxikopoiisi", giving it "true" as a value
         public void arxikopoiisi ()
         {     for (int i=0;i<availability.length;i++)
              {     availability[i]=true;
    My problem now is an exception in thread "main" java.lang.NullPointerException at this line:
    {     availability=false; telephones[i]=tilefwno;
    Any more ideas?
    Regards,
    philimonas

  • I am not able to access the email, I do not know what the password is and cannot seem to get it reset.

    the image keeps telling me
    Login Failed
    Login to server mail.portnel.com failed.
    with options of Retry / Enter New Password / Cancel
    I really need this fixed as I am looking for work and this is my main email

    Forgotten passwords are reset with your email provider. Thunderbird is email client software that runs on your computer and has nothing to do with administering your email password.
    Go to your providers web mail or email help page and see if your password works there. If not, look for a link to reset it.
    If it works there then you may have an incorrect server setting or an overactive antivirus software causing issues.

  • HD version of episodes mandatory !?

    Hello all,
    I have a problem/question because I just "purchased" free TV episodes on iTunes store and, as they are available in HD, iTunes is repeatingly trying to downlload the HD version of the episodes (which are huge of course) and I do NOT want this to happen !
    (because I am living abroad where the internet connection is very limited and furthermore I don't need these HD versions).
    How can I do this ? Because every time I launch iTunes or I make a new purchase these downloads keep coming back in the list : very annoying in fact.
    Furthermore, I deleted these episodes from iTunes (the "normal" version) and, still, they continue to come for download : is there a mean to stop this HD version and/or to definitely cancel a "purchase"?
    Many thanks for your assistance because this drives me crazy.
    Best regards,
    DD

    Well actually this what I did, out of any alternative.
    Fortunately enough I have now an "unlimited transfer" Internet connection, because previously I was limited to 10Gb/month and then it was still a problem ...
    Anyway it's sad that they didn't foresee the possibility to choose your download or cancel a download forever.
    Thanks for the comment anyway.

  • Can't open pdf file linked through a ASPX link in Safari

    I'm a new Mac user so sorry if this is basic. It appears when I click on a link in Safari that should open a PDF file (link uses a ASP link) I get the download box instead. I can download the file to my desktop and open it with adobe from there. I just downloaded the latest adobe reader. This is a new intel iMac (10.4.8). If I click directly on a link to a PDF file it opens in Safari with no problem. The specific link I'm having trouble with is :
    http://www.rochester.k12.mi.us/download.aspx?ft=MzAwMTV8fHwyNC4xOTIuMTM5LjE4NXx8 MS8yLzIwMDcgODo0OTozNyBQTQ%3D%3D
    It seems to see the file as having a ".pdf.exe" extension so doesn't open it with adobe but sees it as an application so offers to download or cancel.
    Really clicking on any PDF link from this page causes the same problem : http://www.rochester.k12.mi.us/index.asp?folder=15700&name=Physical%20Science
    These links act OK using IE. Any suggestions would be appreciated.
    Thanks...Jim

    Sorry for the insufficient info.
    My environment is Windows 7 64bit.
    The PDF was converted from Word file and for example the link which should open a local file was working on version 10.1.1.33 (like first picture below) but not anymore after updating to 10.1.4(second one).
    Can you help me with this?

  • Trying to Install on a weird machine, need FB [UNSOLVED]

    I have a rather old system I want to install Arch on, and it has a built in video card that it has to use.  The problem is that the video card doesn't support a standard linux console well, and the text is all distorted.  This normally isn't a problem because it does support framebuffer mode quite well.  Unfortunately, it doesn't seem like there is an option for using a framebuffer on arch install disks.  Any suggestions?

    Yeah I tried that that.  arch vga=(whatever the number combination for 1024 is).
    Didn't work.  I absolutely love arch, my favorite distro I have tried in years.  The limited installer, however, caught me off gaurd.  I come from gentoo who didnt even have an installer really forever, so its not that I need a gui, but its almost as if the installer restricts a person too much.  For instance, on one box I installed, arch didn't quite detect my device order correctly for grub. So it was trying to install the boot loader, using hd2 when it was really hd1.  There was no way for me to get a grub prompt, and when I accessed it from the command line, the block devices weren't mapped to my fresh install yet.  I had to fiddle for like 30 minutes before I decided to manually copy contents from arch's /dev directory into the new install /dev directory, chroot in, then rerun grub to install. 
    Not a big deal, but the hassle could have been solved with a simple grub prompt menu option with all their cleverly mapped devices.  (yeah there was probably even an easier way around this, but its beside the point)  Now the lack of framebuffer option is getting me.  Its not even a tough thing to include, but its absence is causing unneeded effort on my part.

  • Oracle team members, this is Q for you...

    Dear members of Oracle OLEDB team, you are the only one who can answer this (one page at oracle.com says that you are monitoring this forum):
    ADO has Cancel method both on Command and Recordset object, which should cancel pending async call (every damn page on Internet says so). Oracle OCI interface has OCIBreak method that does exactly that. Now, why is Cancel method not working anything but waiting till the async call execution is fully completed (the call to Cancel method really blocks the calling thread!!) - it does not cancel anything, it just blocks the code !
    I can expect that Microsoft didn't bother about this "insignificant" issue, but this is Oracle provider for Oracle server written by Oracle... - why is your provider behaving the same ?
    I expect you to reply with really good explanation to this quite important issue, this is not a hundredth-time-"how to retrieve recordset from a stored procedure"-beginners-question
    Thanks in advance.
    P.S.
    Please don't misunderstand, fetching is not a problem, only "heavy" command execution ("heavy" select statement in my case)

    There was, in the early 8.1.7 days at least, a bug in OCI where the break/ cancel call didn't work properly. I have no idea whether it was fixed or not and I've long since forgotten the number. You may be able to find it on metalink. You don't say what version of the client you have or whether you've installed any patchsets for the client. If you're not on the latest patchset for your platform, and your platform isn't at least 8.1.7, I'd strongly suggest upgrading.
    Note that as a general rule, these forums aren't monitored by Oracle developers. From time to time they'll pop by, but it's not something that's likely to be their #1 priority. You could log a TAR on metalink to get an answer from an Oracle person.
    Justin

  • Urgent: Facing problem with restoratio​n prosses

    Good day,
    I'm Facing problem with restoration process. During restoring my data from my PC to my Q10 phone using link app. the application reject my request & kept giving me following error:
    Operation Cancelled.
    Really need your help Gent’s & I'll be so much glad for anyone help me to solve this matter.
    Thx.

    Hello
    Are you restoring from same device to same device or to different device?

  • Itunes. How to convert wma to acc

    Hello,
    I am wondering how i can convert all my WMA files into ACC files. Itunes did do it automatically when 1st loaded to this computer, but i cancelled application, really stupid move on my part, and i have no idea how restart this process. Can anyone please help?
    Regards Jon

    Peabody, for me, Adapter is the ticket, and a free one at that. Quick, easy to use, nice interface and very flexible in terms of formats, destinations, etc. Also converts video. Been using it for a month and love it.
    http://www.macroplant.com/adapter/?utm_source=Adapter+%28Mac%29&utm_medium=deskt op+app&utm_campaign=Adapter+%28Mac%29+1.4.3

  • Press 1 if you think Verizon Customer Service is Awful

    I consider myself Verizon's idea of the "perfect" customer. 
    First, I have the FIOS Bundle package (phone, internet, TV) with all the bells and whistles, including all the movie channels and sports packages. 
    And, until very recently, I was a longtime Verizon wireless customer.
    The problem is that Verizon treats me like I'm some kind of idiot.  I get an e-mail that reads (in part): "According to our records, you have not yet accepted the FiOS Bundle Customer Agreement that contains the terms and conditions covering your Verizon FiOS Triple Bundle. In order to receive the discounts associated with this bundle for 12 consecutive months, please review and accept the agreement...."
    OK, fine. So I click the link. It asks me for my username and password.  I try to use my Verizon logon. No, apparently that doesn't work.  I need another username/password. 
    I call up support, and after going through a bunch of convoluted menus, I get through to a human being who says I need to talk to someone from e-center. {word filter avoidance}   Apparently, I need a username and password from there.  I tell the customer service person I'd like to confirm my bundle via the mail.  "I'm sorry, you can't do that.  We need you to confirm this online so that we have recourse in case you cancel."
    Really!! That's funny because I didn't have to go online to confirm my cell phone plan (formerly with Verizon), and I sure {edited} don't need to go online to any of the other bills that have for electricity, gas, water.  Apparently, FIOS is so incredible you can only do it online.  The customer person says, "It's like a digital fingerprint!!"  Oh, really! Gosh, thanks!
    So I realize nothing will come of this rant, but you {word filter avoidance}  who run this company should really {please keep your posts courteous}  try calling your own company's customer service lines to see what it's like.
    And while I'm at it, as a former Verizon shareholder you really made an idiot move by not coming to some sort of agreement with Apple to be the exclusive carrier of the iPhone.  I give you kudos for investing so heavily in fiber so many years ago, but your customer service is awful.  Just awful.
    Message Edited by KaLin on 01-14-2009 11:48 AM

    1,1,1,1,1,1,1,1,1 !!!!! 
    Your post on the forum is DEAD ON !!!  I've spent two days trying to deal with Verizon. The customer service is NON EXISTANT !!!  It took 6 hours (at my work) trying to find somone who even remotely knew where and how to begin to help. Unfortunately, (status quo) I was put on hold and we were disconnected.  Gee, I'm not too ticked off at this point, I've only been disconnected like 20 times since.
    After going home, and spending another 2 1/2 hours on the phone with Verizon, the issues with the services I chose are straightened out. I think???
    Now .......I'm trying to activate the bundle online.  WHAT A JOKE !!!!  Their stupid www.verizon.net/fiosbundleterms website doesn't work. After reading other posts, it appears mailing it in doesn't work either.
    I'm so sorry I ever switched from COMCAST. At least their customer service system worked. I am regretting the day when I have real problems, like with the equipment, etc. Hats off to the COMCAST customer service !!!
    Dear Verizon,
    If you even care to read these forums you will do SOMETHING about your customer service issues. It's apalling. I spit on you.  Please tell me what you spent the MILLIONS of dollars on.
    signed,
    a very ticked off customer.....
    (and it's only been 2 weeks since the install)

Maybe you are looking for