addLog

Add a log file

@param {String}  path        The path's file
@param {Boolean} selected    Whether the file is selected. Default false.

@return      all files
504377
function (path, selected) {

                if (!pathInFiles(path)) {
                    var file;

                    //if path is string, we constructthe good object
                    if (typeof path === 'string') {
                        file = {
                            name : basename(path),
                            path : path,
                            selected : selected || false
                        };
                    } else {
                        //TODO : check something ?
                        file = path;
                    }

                    files.push(file);
                }
                return files;
            }
413355
function writeLog(entries){
    var output = '';

    _.each(entries, function(entry){
        output += entry + '\n';
    });

    return fs.appendFileAsync(this.config.path, output);
}
305535
public T addFile(final String name, final List<String> path, final byte[] newHash, final boolean isDirectory) {
        return addFile(name, path, newHash, isDirectory, null);
    }
178851
public static void logFileCreation(final Logger logger, final String path)
	{

		logger.logMessage(Level.INFO, "New File created:\t" + path);
	}
53112
public boolean includePath(String path) {
        if (path.startsWith("/hawkular/apm")) {
            return false;
        }

        int dotPos = path.lastIndexOf('.');
        int slashPos = path.lastIndexOf('/');
        if (dotPos <= slashPos) {
            return true;
        }

        if (!fileExtensionWhitelist.isEmpty()) {
            String extension = path.substring(dotPos + 1);
            if (fileExtensionWhitelist.contains(extension)) {
                if (log.isLoggable(Level.FINER)) {
                    log.finer("Path " + path + " not skipped, because of whitelist");
                }
                return true;
            }
        }

        if (log.isLoggable(Level.FINER)) {
            log.finer("Path " + path + " skipped");
        }
        return false;
    }
889209
private long addFilesInDir(Path path, List<FileStatus> files, boolean logExcludedFiles)
			throws IOException {
		final FileSystem fs = path.getFileSystem();

		long length = 0;

		for(FileStatus dir: fs.listStatus(path)) {
			if (dir.isDir()) {
				if (acceptFile(dir) && enumerateNestedFiles) {
					length += addFilesInDir(dir.getPath(), files, logExcludedFiles);
				} else {
					if (logExcludedFiles && LOG.isDebugEnabled()) {
						LOG.debug("Directory "+dir.getPath().toString()+" did not pass the file-filter and is excluded.");
					}
				}
			}
			else {
				if(acceptFile(dir)) {
					files.add(dir);
					length += dir.getLen();
					testForUnsplittable(dir);
				} else {
					if (logExcludedFiles && LOG.isDebugEnabled()) {
						LOG.debug("Directory "+dir.getPath().toString()+" did not pass the file-filter and is excluded.");
					}
				}
			}
		}
		return length;
	}
418333
function add(file) {
  var self = this
  var origin

  if (string(file)) {
    file = vfile(file)
  }

  /* Prevent files from being added multiple times. */
  origin = file.history[0]

  if (self.origins.indexOf(origin) !== -1) {
    return self
  }

  self.origins.push(origin)

  /* Add. */
  self.valueOf().push(file)
  self.expected++

  /* Force an asynchronous operation.
   * This ensures that files which fall through
   * the file pipeline immediately (e.g., when
   * already fatally failed) still queue up
   * correctly. */
  setImmediate(add)

  return self

  function add() {
    self.emit('add', file)
  }
}
1324931
private static void addFile(File file, String path, ZipOutputStream out) throws UtilException {
		BufferedInputStream in = null;
		try {
			in = FileUtil.getInputStream(file);
			addFile(in, path, out);
		} finally {
			IoUtil.close(in);
		}
	}
70951
function writeLogFile(file, line) {
     
    if (file === undefined || file === null) {
        return;
    }
    
    fs.appendFile(file, line + os.EOL, {}, function() {
        //
    });
}
1144274
B append(BasePath<B> path) {
    ImmutableList.Builder<String> components = ImmutableList.builder();
    components.addAll(this.getSegments());
    components.addAll(path.getSegments());
    return createPathWithSegments(components.build());
  }
374024
public static File checkFolderPath(final String path, final boolean create) {
		final File file = new File(path);
		if (!file.exists()) {
			if (create) {
				file.mkdir();
			}
			return null;
		}
		return file;
	}
1353124
public ErrorLog doInitErrorLog(String path) throws IOException
   {
      File file = new File(new File(path), ERROR_LOG);
      return new ErrorLog(file, errorLogfileSize);
   }
947778
function overwriteFile(path, options) {
  let fileContent = null;
  let newData = null;

  try {
    fileContent = fs.readFileSync(path, 'utf8');
    newData = visit(JSON.parse(fileContent), options);
  } catch (e) {
    console.error('Failed to retrieve json object from file');
    throw e;
  }

  let indent;

  if (options && options.indentSize) {
    indent = options.indentSize;
  } else {
    indent = detectIndent(fileContent).indent || DEFAULT_INDENT_SIZE;
  }

  const newLine = detectNewline(fileContent) || '\n';
  let newFileContent = JSON.stringify(newData, null, indent);

  if (!(options && options.noFinalNewLine)) {
    // Append a new line at EOF
    newFileContent += '\n';
  }

  if (newLine !== '\n') {
    newFileContent = newFileContent.replace(/\n/g, newLine);
  }

  fs.writeFileSync(path, newFileContent, 'utf8');
  return newData;
}
285825
function createGenerateLog(inPath) {
    if (!inPath) {
        throw new Error('Input path argument is required');
    }

    return function generateLog() {
        return gulp.src(inPath)
            .pipe(conventionalChangelog({ preset: 'angular' }))
            .pipe(gulp.dest(file => file.base));
    };
}
1191114
def add(self, path):
        '''
        
        '''
        with salt.utils.files.fopen(path, 'rb') as ifile:
            for chunk in iter(lambda: ifile.read(self.__buff), b''):
                self.__digest.update(chunk)
169952
public Resource addPath(String path)
        throws IOException,MalformedURLException
    {
        FileResource r=null;

        if (!isDirectory())
        {
            r=(FileResource)super.addPath(path);
        }
        else
        {
            path = org.browsermob.proxy.jetty.util.URI.canonicalPath(path);
            
            // treat all paths being added as relative
            String rel=path;
            if (path.startsWith("/"))
                rel = path.substring(1);
            
            File newFile = new File(_file,rel.replace('/', File.separatorChar));
            r=new FileResource(newFile.toURI().toURL(),null,newFile);
        }
        
        String encoded= org.browsermob.proxy.jetty.util.URI.encodePath(path);
        int expected=r._urlString.length()-encoded.length();
        int index = r._urlString.lastIndexOf(encoded, expected);
        
        if (expected!=index && ((expected-1)!=index || path.endsWith("/") || !r.isDirectory()))
        {
            r._alias=r._url;
            r._aliasChecked=true;
        }                   
        return r;
    }
680769
def add(path)
      return true unless File.exist?(path)

      metadata[path] = {
        "mtime" => File.mtime(path),
        "deps"  => [],
      }
      cache[path] = true
    end