src/main/java/zoot/tube/googleapi/RefreshTokenSaver.java
/**
     * Saves a user's refresh-token to a file that can be loaded when
     * the application restarts.
     *
     * @param user         the user.
     * @param refreshToken the refresh-token.
     */
Saves a user's refresh-token to a file that can be loaded when
the application restarts.

@param user         the user.
@param refreshToken the refresh-token.
Saves a user ' s refresh - token to a file that can be loaded when the application restarts . @param user the user . @param refreshToken the refresh - token .
public static void saveRefreshToken(String user, String refreshToken) {
        File file = new File(String.format("%s/%s", RESOURCES_USERS, user));
        FileWriter writer = null;
        try {
            writer = new FileWriter(file);
            writer.write(refreshToken);
        } catch (IOException e) {
            System.err.println(String.format("Error saving user: \"%s\"'s token.", user));
        } finally {
            try {
                if (writer != null) {
                    writer.flush();
                    writer.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
public static void saveRefreshToken ( String user , String refreshToken ) { File file = new File ( String . format ( "%s/%s" , RESOURCES_USERS , user ) ) ; FileWriter writer = null ; try { writer = new FileWriter ( file ) ; writer . write ( refreshToken ) ; } catch ( IOException e ) { System . err . println ( String . format ( "Error saving user: \"%s\"'s token." , user ) ) ; } finally { try { if ( writer != null ) { writer . flush ( ) ; writer . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } }
Saves a user's refresh-token to a file that can be loaded when
 the application restarts.
Saves a user ' s refresh - token to a file that can be loaded when the application restarts .