private static Credentials DeSerializeCredentials()

in java/src/main/java/com/alexa/awisapi/AWIS.java [258:275]


  private static Credentials DeSerializeCredentials() throws java.io.IOException
  {
    ObjectInputStream objectinputstream = null;
    try {
        FileInputStream streamIn = new FileInputStream(AWIS.credentialsFile);
        objectinputstream = new ObjectInputStream(streamIn);
        Credentials credentials = (Credentials) objectinputstream.readObject();
        Date credsExpiration = credentials.getExpiration();
        Date now = new Date();
        return (credsExpiration.compareTo(now) > 0) ? credentials : null;
    } catch (Exception e) {
        return null;
    } finally {
        if(objectinputstream != null){
            objectinputstream .close();
        }
    }
  }