Use it only to display proper path in log

@param targetFilename
513450
private String getFullPathForLog(OutputResult or, String targetFilename) {
        if (or.sameDirectory()) {
            return targetFilename;
        } else {
            return or.getGeneratedSource().getFullPath(targetFilename);
        }
    }
642608
public static void copyFolder(String sourcePath, String targetPath, final String filterName,
         final boolean recursive) throws IOException
   {
      File path = new File(targetPath);
      if (!path.exists())
      {
         if (!path.mkdirs())
            throw new IOException("outdir can't be created");
      }
      File a = new File(sourcePath);
      String[] fileNames = a.list(new FilenameFilter()
      {
         public boolean accept(File dir, String fname)
         {
            if (new File(dir, fname).isDirectory())
            {
               return true;
            }
            else
            {
               return fname.endsWith(filterName);
            }
         }

      });
      File jarFile = null;
      if (fileNames != null)
      {
         for (String fileName : fileNames)
         {
            jarFile = new File(sourcePath + File.separator + fileName);

            if (jarFile.isFile())
            {
               copyFile(jarFile, targetPath);
            }
            if (recursive && jarFile.isDirectory())
            {
               copyFolder(sourcePath + File.separator + fileName, targetPath + File.separator + fileName, filterName,
                     recursive);
            }
         }
      }
   }
25112
public static void copyDirectory(File sourceLocation, File targetLocation) throws IOException {

        if (sourceLocation.isDirectory()) {
            if (!targetLocation.exists()) {
                if (targetLocation.mkdir() == false) {
                    logger.debug("Creating target directory " + targetLocation + " failed.");
                }
            }

            String[] children = sourceLocation.list();
            if (children == null) {
                return;
            }

            for (int i = 0; i < children.length; i++) {
                copyDirectory(new File(sourceLocation, children[i]), new File(targetLocation, children[i]));
            }
        } else {
            FileInputStream in = null;
            FileOutputStream out = null;
            try {
                in = new FileInputStream(sourceLocation);
                out = new FileOutputStream(targetLocation);
                copyStream(in, out);
            } finally {
                if (in != null) {
                    in.close();
                }
                if (out != null) {
                    out.close();
                }
            }
        }
    }
1003171
public static List<String> readLines(Path targetPath, String charsetName) {
        try {
            return Files.readAllLines(targetPath, Charset.forName(charsetName));
        } catch (IOException e) {
            return JMExceptionManager.handleExceptionAndReturnNull(log, e,
                    "readLines", targetPath, charsetName);
        }
    }
1354705
public synchronized void markForRebuild(final TargetInfo targetInfo) {
    //
    // if it must already be rebuilt, no need to check further
    //
    if (!targetInfo.getRebuild()) {
      final TargetHistory history = get(targetInfo.getConfiguration().toString(), targetInfo.getOutput().getName());
      if (history == null) {
        targetInfo.mustRebuild();
      } else {
        final SourceHistory[] sourceHistories = history.getSources();
        final File[] sources = targetInfo.getSources();
        if (sourceHistories.length != sources.length) {
          targetInfo.mustRebuild();
        } else {
          final Hashtable<String, File> sourceMap = new Hashtable<>(sources.length);
          for (final File source : sources) {
            try {
              sourceMap.put(source.getCanonicalPath(), source);
            } catch (final IOException ex) {
              sourceMap.put(source.getAbsolutePath(), source);
            }
          }
          for (final SourceHistory sourceHistorie : sourceHistories) {
            //
            // relative file name, must absolutize it on output
            // directory
            //
            final String absPath = sourceHistorie.getAbsolutePath(this.outputDir);
            File match = sourceMap.get(absPath);
            if (match != null) {
              try {
                match = sourceMap.get(new File(absPath).getCanonicalPath());
              } catch (final IOException ex) {
                targetInfo.mustRebuild();
                break;
              }
            }
            if (match == null || match.lastModified() != sourceHistorie.getLastModified()) {
              targetInfo.mustRebuild();
              break;
            }
          }
        }
      }
    }
  }
463305
private static void printTargetPathList(FileStatus[] targetTmpFiles)
    {
        StringBuilder builder = new StringBuilder();
        builder.append("Preprocess target files:");
        String lineSeparator = System.getProperty("line.separator");

        for (FileStatus targetFile : targetTmpFiles)
        {
            builder.append(targetFile.getPath() + lineSeparator);
        }

        logger.info(builder.toString());
    }
227273
public void reportHTML(final Path target) throws IOException {
        
        Files.createDirectories(target.toAbsolutePath().getParent());
        
        LOGGER.info(() -> "Preparing HTML Report '" + title + "' to path: " + target);
        
        String html = UUtils.readResource("net/tuis/ubench/scale/UScale.html");
        Map<String, String> subs = new HashMap<>();
        subs.put("DATA", toJSONString());
        
        subs.put("TITLE", title);
        for (Map.Entry<String, String> me : subs.entrySet()) {
            html = html.replaceAll(Pattern.quote("${" + me.getKey() + "}"), Matcher.quoteReplacement(me.getValue()));
        }
        Files.write(target, html.getBytes(StandardCharsets.UTF_8));
        LOGGER.info(() -> "Completed HTML Report '" + title + "' to path: " + target);
    }
43265
public void setLocation(String filename, int line) throws IOException
  {
    if (_lineMap != null && filename != null && line >= 0) {
      _lineMap.add(filename, line, _destLine, _isPreferLast);
    }
  }
529211
def __set_log_file_name(self):
        """"""
        # ensure directory exists
        dir, _ = os.path.split(self.__logFileBasename)
        if len(dir) and not os.path.exists(dir):
            os.makedirs(dir)
        # create logFileName
        self.__logFileName = self.__logFileBasename+"."+self.__logFileExtension
        number = 0
        while os.path.isfile(self.__logFileName):
            if os.stat(self.__logFileName).st_size/1e6 < self.__maxlogFileSize:
                break
            number += 1
            self.__logFileName = self.__logFileBasename+"_"+str(number)+"."+self.__logFileExtension
        # create log file stram
        self.__logFileStream = None
1138936
function targetPath(fromPath, basePath, targetDirectory) {
  // console.log('targetPath:fromPath: ' + fromPath);
  // console.log('targetPath:basePath: ' + basePath);
  // console.log('targetPath:targetDirectory: ' + targetDirectory);
  var relativePath = path.relative(basePath, fromPath);
  // console.log('targetPath:relativePath: ' + relativePath);
  // console.log('targetPath: ' + path.resolve(targetDirectory, relativePath));
  return path.resolve(targetDirectory, relativePath);
}
569
def mark_log(self, filename='system.log'):
        
        log_file = os.path.join(self.get_path(), 'logs', filename)
        if not os.path.exists(log_file):
            return 0
        with open(log_file) as f:
            f.seek(0, os.SEEK_END)
            return f.tell()
238386
private String get_target_name (String ttype_tname)
  {
    String[] split;
    try {
      split = ttype_tname.split(LOGGING_SEPARATOR);
    } catch (Exception e) {
      return _DefaultTargetName;
    }
    return (split.length > 1) ? split[1] :  _DefaultTargetName;
  }
603472
private String setCurrentFilename(String relativePathOrPackage, String filename, String domain) throws Exception {
        currentFullFilename = convertToFullFilename(relativePathOrPackage, filename, domain);
        return "";
    }
694218
private void cleanTargetDirectory(PrintStream logger, String targetDirectory) throws IOException {
        File target = new File(targetDirectory);
        if (target.exists()) {
            File[] subfolders = target.listFiles((FilenameFilter) DirectoryFileFilter.INSTANCE);
            if (subfolders.length > 0) {
                logger.println("  Cleaning target directory...");
            }
            for (File subfolder : subfolders) {
                if (subfolder.listFiles((FilenameFilter) new SuffixFileFilter(".vproj")).length > 0) {
                    logger.println("    Deleting subfolder of target directory: " + subfolder.getAbsolutePath());
                    FileUtils.deleteDirectory(subfolder);
                } else {
                    logger.println("    Skipping delete of directory '" + subfolder.getAbsolutePath() + "' because it does not contain any *.vproj file.");
                }
            }
        }
    }
219842
@InterfaceAudience.Private
    private static String nameOfDatabaseAtPath(String path) {
        String name = FileDirUtils.getDatabaseNameFromPath(path);
        return isWindows() ? name.replace('/', '.') : name.replace('/', ':');
    }
1270828
public void addMapping(String path, Object target) {
        vHostTable.put(normalize(path), target);
    }
1240040
public void add_logging_target (Logger logger, String ttype_tname) throws DevFailed
	{
    //- Check input (is logger valid)
    if (logger == null) {
     return;
    }
    //- Avoid case sensitive troubles
    ttype_tname = ttype_tname.toLowerCase();
    //- Split ttype_tname into target type and name
        String ttype = get_target_type(ttype_tname);
    String tname = get_target_name(ttype_tname);
    //- Find out target type
    int type_id = LOGGING_UNKNOWN_TARGET_ID;
    if (LOGGING_FILE_TARGET.equals(ttype)) {
      type_id = LOGGING_FILE_TARGET_ID;
    }
    else if (LOGGING_DEVICE_TARGET.equals(ttype)) {
      type_id = LOGGING_DEVICE_TARGET_ID;
    }
    else if (LOGGING_CONSOLE_TARGET.equals(ttype)) {
      type_id = LOGGING_CONSOLE_TARGET_ID;
    }
    else {
      String desc = "Invalid logging target type specified (" + ttype + ")";
      Except.throw_exception("API_MethodArgument", desc, "Logging::add_logging_target");
    }
    //- Full file name for file target
    String full_file_name = null;
    //- Internal target name
    String appender_name = ttype + LOGGING_SEPARATOR;
    switch (type_id) {
      case LOGGING_FILE_TARGET_ID:
        if (tname.equals(_DefaultTargetName)) {
          //- use default path and file name
          full_file_name = logging_path + "/";
          full_file_name += device_to_file_name(logger.getName()) + ".log";
        }
        else if (tname.indexOf('/') != -1) {
          //- user specified path and file name
          full_file_name = tname;
        }
        else {
          //- user specified file name
          full_file_name = logging_path + "/" + tname;
        }
        File file = new File(full_file_name);
        File dir = new File(file.getParent());
          if (dir.isDirectory() == false) {
          try {
            dir.mkdirs();
          }
          catch (Exception e) {
            String desc = "Failed to create directory " + dir.getPath();
            Except.throw_exception("API_SystemException", desc, "Logging::add_logging_target");
          }
        }
        tname = full_file_name;
        appender_name += tname;
        break;
      case LOGGING_DEVICE_TARGET_ID:
        if (tname.equals(_DefaultTargetName)) {
          String desc = "Device target name must be specified (no default value)";
          Except.throw_exception("API_MethodArgument", desc, "Logging::add_logging_target");
        }
        appender_name += tname;
        break;
      case LOGGING_CONSOLE_TARGET_ID:
        appender_name += LOGGING_CONSOLE_TARGET;
        break;
    }
    //- Attach appender to the logger (if not already attached)
    Appender appender = logger.getAppender(appender_name);
        if (appender != null) {
            Util.out4.println("Target " + appender_name + " is already attached to " + logger.getName());
      return;
    }
    //- Instanciate the appender
    try {
      Util.out4.println("Adding " + appender_name + " to " +  logger.getName());
      switch (type_id) {
        case LOGGING_FILE_TARGET_ID:
			//noinspection NestedTryStatement
			try {
			  appender = new TangoRollingFileAppender(appender_name, full_file_name, rft);
			} catch (IOException ioe) {
			  String desc = "Could not open logging file " + full_file_name;
			  Util.out4.println(desc);
			  Except.throw_exception("API_CannotOpenFile", desc, "Logging::add_logging_target");
			}
          break;
        case LOGGING_DEVICE_TARGET_ID:
          appender = new TangoDeviceAppender(logger.getName(), appender_name, tname);
          break;
        case LOGGING_CONSOLE_TARGET_ID:
          appender = new TangoConsoleAppender(appender_name);
          break;
      }
      //- Attach appender to the logger
      logger.addAppender(appender);
      Util.out4.println("Added logging target " + appender_name + " to " +  logger.getName());
    }
    catch (DevFailed df) {
      throw df;
    }
    catch (Exception e) {
      String desc = "System exception caugth while trying to add target " + ttype_tname + " to " +  logger.getName();
      Except.throw_exception("API_SystemException", desc, "Logging::add_logging_target");
    }
    }