public File getOutputFile ( File input , String ext ) { File source ; File destination ; if ( input . getAbsolutePath ( ) . startsWith ( internalSources . getAbsolutePath ( ) ) ) { source = internalSources ; destination = destinationForInternals ; } else if ( input . getAbsolutePath ( ) . startsWith ( externalSources . getAbsolutePath ( ) ) ) { source = externalSources ; destination = destinationForExternals ; } else { return null ; } String jsFileName = input . getName ( ) . substring ( 0 , input . getName ( ) . length ( ) - ".ts" . length ( ) ) + "." + ext ; String path = input . getParentFile ( ) . getAbsolutePath ( ) . substring ( source . getAbsolutePath ( ) . length ( ) ) ; return new File ( destination , path + "/" + jsFileName ) ; }
Gets the output file for the given input and the given extension .