question: void putFile ( String relativePath , Codebase codebase ) { try { File dest = new File ( rootDirectory . getAbsolutePath ( ) , relativePath ) ; File src = codebase . getFile ( relativePath ) ; boolean srcExists = filesystem . exists ( src ) ; boolean destExists = filesystem . exists ( dest ) ; boolean srcExecutable = filesystem . isExecutable ( src ) ; boolean destExecutable = filesystem . isExecutable ( dest ) ; if ( ! srcExists && ! destExists ) { throw new MoeProblem ( "Neither src nor dests exists. Unreachable code:%n%s%n%s%n%s" , relativePath , src , dest ) ; } if ( ! srcExists ) { util . runSvnCommandWithWorkingDirectory ( rootDirectory . getAbsolutePath ( ) , "rm" , relativePath ) ; return ; } try { filesystem . makeDirsForFile ( dest ) ; filesystem . copyFile ( src , dest ) ; } catch ( IOException e ) { throw new MoeProblem ( e . getMessage ( ) ) ; } if ( ! destExists ) { util . runSvnCommandWithWorkingDirectory ( rootDirectory . getAbsolutePath ( ) , "add" , "--parents" , relativePath ) ; } String mimeType = guessMimeType ( relativePath ) ; if ( mimeType != null ) { try { util . runSvnCommandWithWorkingDirectory ( rootDirectory . getAbsolutePath ( ) , "propset" , "svn:mime-type" , mimeType , relativePath ) ; } catch ( CommandRunner . CommandException e ) { ui . message ( "Error setting mime-type for %s" , relativePath ) ; } } if ( destExecutable != srcExecutable ) { if ( srcExecutable ) { util . runSvnCommandWithWorkingDirectory ( rootDirectory . getAbsolutePath ( ) , "propset" , "svn:executable" , "*" , relativePath ) ; } else { util . runSvnCommandWithWorkingDirectory ( rootDirectory . getAbsolutePath ( ) , "propdel" , "svn:executable" , relativePath ) ; } } } catch ( CommandRunner . CommandException e ) { throw new MoeProblem ( "problem occurred while running svn: " + e . stderr ) ; } }
target:  Put file from c into this writer. (Helper function.)