src/main/java/zoot/tube/googleapi/RefreshTokenSaver.java
/**
     * Loads the specified user's refresh-token if one has been saved.
     * <p>
     * If there is no file for the user, an empty string will be returned.
     *
     * @param user the user.
     * @return the refresh-token if it exists, otherwise an empty string.
     */
Loads the specified user's refresh-token if one has been saved.

If there is no file for the user, an empty string will be returned.

@param user the user.
@return the refresh-token if it exists, otherwise an empty string.
Loads the specified user ' s refresh - token if one has been saved . If there is no file for the user an empty string will be returned . @param user the user . @return the refresh - token if it exists otherwise an empty string .
public static String loadRefreshToken(String user) {
        File file = new File(String.format("%s/%s", RESOURCES_USERS, user));
        BufferedReader reader = null;
        String token = "";
        try {
            reader = new BufferedReader(new FileReader(file));
            token = reader.readLine();
        } catch (IOException e) {
            System.err.println(String.format("File for user: \"%s\" does not exist", user));
        } finally {
            try {
                if (reader != null) {
                    reader.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return token;
    }
public static String loadRefreshToken ( String user ) { File file = new File ( String . format ( "%s/%s" , RESOURCES_USERS , user ) ) ; BufferedReader reader = null ; String token = "" ; try { reader = new BufferedReader ( new FileReader ( file ) ) ; token = reader . readLine ( ) ; } catch ( IOException e ) { System . err . println ( String . format ( "File for user: \"%s\" does not exist" , user ) ) ; } finally { try { if ( reader != null ) { reader . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } return token ; }
Loads the specified user's refresh-token if one has been saved.
Loads the specified user ' s refresh - token if one has been saved .