public static boolean setCurrentFile ( File databaseDir , long descriptorNumber ) throws IOException { String manifest = descriptorFileName ( descriptorNumber ) ; String temp = tempFileName ( descriptorNumber ) ; File tempFile = new File ( databaseDir , temp ) ; writeStringToFileSync ( manifest + "\n" , tempFile ) ; File to = new File ( databaseDir , currentFileName ( ) ) ; boolean ok = tempFile . renameTo ( to ) ; if ( ! ok ) { tempFile . delete ( ) ; writeStringToFileSync ( manifest + "\n" , to ) ; } return ok ; }
Make the CURRENT file point to the descriptor file with the specified number .