title: having issues calling a method in java
body: <p>a simple question but i litterally can not remember, basically i want to run java methods in an certain order, i did have it working perfectly, but i have had to add something to the start and now it will not run in order </p>
  
  <p>Basically before was this code, </p>
  
  <pre><code>@PostConstruct
      public void init() {
  
  
          //System.out.println(destinationPDF);
          //System.out.println(destination);
  
  // Get the username from the login page, this is used to create a folder for each user
          System.out.println("called get username");
          username = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
      }
  
      public void File() {
          File theFile = new File(destination + username); // will create a sub folder for each user (currently does not work, below hopefully is a solution)
          theFile.mkdirs();
          System.out.println("Completed File");
      }
  </code></pre>
  
  <p>it would run and automatically call the next required method, it would call them in this order :</p>
  
  <pre><code>INFO: buttonToUploadText invoked
  INFO: called get username
  INFO: called handle file
  INFO: Completed Creation of folder
  INFO: Now in copying of file proccess
  INFO: Completed Creation of folder for copy of PDF
  INFO: End of copying file creation
  INFO: Called CopyFile
  INFO: New file created!
  INFO: Copying is now happening
  </code></pre>
  
  <p>But i have added a new method, that calls variables from a file :</p>
  
  <pre><code>@PostConstruct
      public void loadProp() {
          System.out.println("Loading properties");
          InputStream in = this.getClass().getClassLoader().getResourceAsStream("config.properties"); //points to a properties file, this will load up destinations instead of having to declare them here
          try {
              configProp.load(in);
              System.out.println(configProp.getProperty("destinationPDF"));
              System.out.println(configProp.getProperty("destination"));
              System.out.println(configProp.getProperty("fileList"));
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
  </code></pre>
  
  <p>This now must run first when it is triggered in order to declare variables, however now it will now run public void int() once complete instead it skips a lot and runs     public void handleFileUpload</p>
  
  <p>so what is the best way of calling public void init() from public void loadProp() {</p>
  
  <p>Edit 2:</p>
  
  <pre><code>    private Properties configProp = new Properties();
  
      public void loadProp() {
          System.out.println("Loading properties");
          InputStream in = this.getClass().getClassLoader().getResourceAsStream("config.properties"); //points to a properties file, this will load up destinations instead of having to declare them here
          try {
              configProp.load(in);
              System.out.println(configProp.getProperty("destinationPDF"));
              System.out.println(configProp.getProperty("destination"));
              System.out.println(configProp.getProperty("fileList"));
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
      private String destinationPDF = configProp.getProperty("destinationPDF");
      public String destination = configProp.getProperty("destination");
      private String username;
      //public static String destination = "D:/Documents/NetBeansProjects/printing~subversion/fileupload/uploaded/"; // main location for uploads//TORNADO ONLY //"D:/My Documents/NetBeansProjects/printing~subversion/fileupload/uploaded/"; // USE ON PREDATOR ONLY 
      public static String NewDestination;
      public static String UploadedfileName;
      public static String CompletefileName;
      //
      //Strings for file copy
      //
      //private String destinationPDF = "D:/Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/pdf/"; //USE ON TORNADO//"D:/My Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/pdf/";//USE ON PREDATOR    
      private String NewdestinationPDF;
      public static String PdfLocationViewable;
  
      //
      @PostConstruct
      public void init() {
  
         FileUploadController.loadProp();
  
          //System.out.println(destinationPDF);
          //System.out.println(destination);
  
  // Get the username from the login page, this is used to create a folder for each user
          System.out.println("called get username");
          username = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
      }
  </code></pre>