public void setupOutputPath ( String name ) { // get stream filename generator IStreamFilenameGenerator generator = ( IStreamFilenameGenerator ) ScopeUtils . getScopeService ( scope , IStreamFilenameGenerator . class , DefaultStreamFilenameGenerator . class ) ; // generate file path String filePath = generator . generateFilename ( scope , name , ".flv" , GenerationType . RECORD ) ; this . path = generator . resolvesToAbsolutePath ( ) ? Paths . get ( filePath ) : Paths . get ( System . getProperty ( "red5.root" ) , "webapps" , scope . getContextPath ( ) , filePath ) ; // if append was requested, ensure the file we want to append exists (append==record) File appendee = getFile ( ) ; if ( IClientStream . MODE_APPEND . equals ( mode ) && ! appendee . exists ( ) ) { try { if ( appendee . createNewFile ( ) ) { log . debug ( "New file created for appending" ) ; } else { log . debug ( "Failure to create new file for appending" ) ; } } catch ( IOException e ) { log . warn ( "Exception creating replacement file for append" , e ) ; } } }
Sets up the output file path for writing .