title: static block not works with @Value in Spring
body: <p>I need to seek help on below issue. I am reading some properties from properties file and assign changed/final values to another variables. I am facing difficulties in changing the static{ } block to normal block or in constructor.</p>
  
  <p>I want all these variables to gets assign value from .properties file at the time of web application load / deployment. Any help ?</p>
  
  <pre><code>private static String username;
  private static String password;
  private static String dbURL;
  private static String dbPort;
  private static String filePath;
  private static File localFile;
  private static File remoteFile;
  
  
  @Value("${local.file.name}")
  private String localFileName;
  
  @Value("${remote.file.name"})
  private String remoteFileName;
  
      static {
          File finalFilePath = new File(filePath);
          if (!finalFilePath.exists() &amp;&amp; !finalFilePath.isDirectory()) {
              finalFilePath.mkdirs();
          }
          localFile = new File(StringBuffer(finalFilePath).append("/").append("localFileName").toString());
          remoteFile = new File(StringBuffer(finalFilePath).append("/").append("remoteFileName").toString());
      }
  </code></pre>