Remove the file content associated with logical path
@param {String} classpath
@param {Boolean} timestampNextTime if true, the next time the logical path is loaded, browser and server
cache will be bypassed by adding a timestamp to the url
174256
function (logicalPath, timestampNextTime) {
            var content = this._cache.content;
            delete content.files[logicalPath];
            var url = this.resolveURL(logicalPath);
            delete content.urls[url];
            if (timestampNextTime) {
                this.enableURLTimestamp(url, true); // browser cache will be bypassed next time the file is loaded
            }
        }
561121
function (classpath, id) {
            this._logs[this._nbLogs++] = {
                classpath : classpath,
                id : id,
                stop : (new Date()).getTime()
            };
        }
666214
public BaseJsonBo removeSubAttr(String attrName, String dPath) {
        Lock lock = lockForWrite();
        try {
            JsonNode attr = cacheJsonObjs.get(attrName);
            JacksonUtils.deleteValue(attr, dPath);
            return (BaseJsonBo) setAttribute(attrName, SerializationUtils.toJsonString(attr),
                    false);
        } finally {
            lock.unlock();
        }
    }
435611
function showDataForTime(catalogItem, currentTime, preloadNext = true) {
  function clearCurrent() {
    catalogItem._imageryLayer = undefined;
    catalogItem._currentIntervalIndex = -1;
    catalogItem._currentInterval = undefined;
  }

  function clearNext() {
    catalogItem._nextLayer = undefined;
    catalogItem._nextIntervalIndex = -1;
    catalogItem._nextInterval = undefined;
  }

  function replaceCurrentWithNext() {
    // Make the new one visible
    setOpacity(catalogItem, catalogItem._nextLayer, catalogItem.opacity);
    fixNextLayerOrder(
      catalogItem,
      catalogItem._imageryLayer,
      catalogItem._nextLayer
    );

    // Get rid of the old one.
    ImageryLayerCatalogItem.disableLayer(
      catalogItem,
      catalogItem._imageryLayer
    );
    catalogItem._imageryLayer = catalogItem._nextLayer;
    if (defined(catalogItem._imageryLayer)) {
      catalogItem._imageryLayer.imageryProvider.enablePickFeatures = true;
    }
    clearNext();
  }
  // Given an interval index, set up an imagery provider and layer.
  function nextLayerFromIndex(index) {
    const imageryProvider = catalogItem.createImageryProvider(
      catalogItem.intervals.get(index).data
    );
    imageryProvider.enablePickFeatures = false;
    catalogItem._nextLayer = ImageryLayerCatalogItem.enableLayer(
      catalogItem,
      imageryProvider,
      0.0
    );
    updateSplitDirection(catalogItem);
    ImageryLayerCatalogItem.showLayer(catalogItem, catalogItem._nextLayer);
  }

  const intervals = catalogItem.intervals;
  if (
    !defined(currentTime) ||
    !defined(intervals) ||
    !catalogItem.isEnabled ||
    !catalogItem.isShown
  ) {
    return;
  }

  const oldIndex = catalogItem._currentIntervalIndex;
  if (
    oldIndex >= 0 &&
    oldIndex < intervals.length &&
    TimeInterval.contains(intervals.get(oldIndex), currentTime) &&
    TimeInterval.equals(intervals.get(oldIndex), catalogItem._currentInterval)
  ) {
    // the currently shown imagery's interval contains the requested time, so nothing to do.
    return;
  }
  // Find the interval containing the current time.
  const currentTimeIndex = intervals.indexOf(currentTime);
  if (currentTimeIndex < 0) {
    // No interval contains this time, so do not show imagery at this time.
    ImageryLayerCatalogItem.disableLayer(
      catalogItem,
      catalogItem._imageryLayer
    );
    clearCurrent();
    return;
  } else if (
    currentTimeIndex !== catalogItem._nextIntervalIndex ||
    !TimeInterval.equals(
      intervals.get(currentTimeIndex),
      catalogItem._nextInterval
    )
  ) {
    // We have a "next" layer, but it's not the right one, so discard it.
    ImageryLayerCatalogItem.disableLayer(catalogItem, catalogItem._nextLayer);

    // Create the new "next" layer, which we will immediately use
    nextLayerFromIndex(currentTimeIndex);
  }

  // At this point we can assume that _nextLayer is applicable to this time.
  replaceCurrentWithNext();
  catalogItem._currentIntervalIndex = currentTimeIndex;
  catalogItem._currentInterval = intervals.get(currentTimeIndex);

  if (preloadNext) {
    // Prefetch the (predicted) next layer.
    // Here we use the terria clock because we want to optimise for the case where the item is playing on the
    // timeline (which is linked to the terria clock) and preload the layer at the next time that the timeslider
    // will move to.
    let nextIndex =
      currentTimeIndex + (catalogItem.terria.clock.multiplier >= 0.0 ? 1 : -1);
    if (
      nextIndex === intervals.length &&
      catalogItem.terria.clock.clockRange === ClockRange.LOOP_STOP
    ) {
      nextIndex = 0;
    }
    if (
      nextIndex >= 0 &&
      nextIndex < intervals.length &&
      (nextIndex !== catalogItem._nextIntervalIndex ||
        !TimeInterval.equals(
          catalogItem._nextInterval,
          intervals.get(nextIndex)
        ))
    ) {
      // Yes, we have found a non-cached, valid time index.
      nextLayerFromIndex(nextIndex);
      catalogItem._nextIntervalIndex = nextIndex;
      catalogItem._nextInterval = intervals.get(nextIndex);
    }
  }
}
1239895
public void open(String filePath, FileSystem fs, boolean isFileSyncEachTime) throws IOException
    {
        Path dstPath = new Path(filePath);

        if (fs.exists(dstPath) == true)
        {
            this.delegateStream = fs.append(dstPath);
        }
        else
        {
            this.delegateStream = fs.create(dstPath);
        }

        this.isFileSyncEachTime = isFileSyncEachTime;
    }
1150627
void removeCache(Path hdfsPath) {
    CacheEntry c = cacheMap.remove(hdfsPath);
    if (c != null) {
      cacheSize.addAndGet(-c.entrySize);
      localMetrics.numRemove++;
      if (LOG.isDebugEnabled()) {
        LOG.debug("LookasideCache removed path:" + hdfsPath +
                  " freed up size: " + c.entrySize);
      }
    }
  }
236046
static void deletePath(String path) {
        try {
            ZkConnection.client.delete().guaranteed().deletingChildrenIfNeeded().forPath(path);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
253985
void remove(String absolutePath) {
      if (absolutePath == null)
         return;
      GridFile.Metadata md = metadata.get(absolutePath);
      if (md == null)
         return;

      int numChunks = md.getLength() / md.getChunkSize() + 1;
      for (int i = 0; i < numChunks; i++)
         data.remove(FileChunkMapper.getChunkKey(absolutePath, i));
   }
216307
function() {
        $module
          .data(metadata.promise, false)
          .data(metadata.xhr, false)
        ;
        $context
          .removeClass(className.error)
          .removeClass(className.loading)
        ;
      }
702707
function (logicalPath) {
            var itm = this._cache.getItem("files", logicalPath, false);
            if (itm && itm.status == this._cache.STATUS_AVAILABLE) {
                return itm.value;
            }
            return null;
        }
529174
@Override
    public T deleteClasses(Class<?>... classes) throws IllegalArgumentException {
        Validate.notNullAndNoNullValues(classes, "Classes must be specified and cannot contain null values");

        for (Class<?> clazz : classes) {
            final ArchivePath path = new BasicPath(getClassesPath(), AssetUtil.getFullPathForClassResource(clazz));

            // We need to remove all the inner classes as well (if present).
            for (ArchivePath innerPath : getInnerClasses(path)) {
                getArchive().delete(innerPath);
            }

            // Remove the class itself.
            getArchive().delete(path);
        }

        return covarientReturn();
    }
1372120
private ClassIndex doIndex(long timestamp, Path originalPath, Iterable<? extends Path> dirs) {
        Set<String> packages = new HashSet<>();
        Map<String, Collection<String>> classSimpleName2FQN = new HashMap<>();

        for (Path d : dirs) {
            try {
                Files.walkFileTree(d, new FileVisitor<Path>() {
                    int depth;
                    @Override
                    public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
                        waitIndexingNotSuspended();
                        if (depth++ == 0)
                            return FileVisitResult.CONTINUE;
                        String dirName = dir.getFileName().toString();
                        String sep = dir.getFileSystem().getSeparator();
                        dirName = dirName.endsWith(sep) ? dirName.substring(0, dirName.length() - sep.length())
                                                        : dirName;
                        if (SourceVersion.isIdentifier(dirName))
                            return FileVisitResult.CONTINUE;
                        return FileVisitResult.SKIP_SUBTREE;
                    }
                    @Override
                    public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                        waitIndexingNotSuspended();
                        if (file.getFileName().toString().endsWith(".class")) {
                            String relativePath = d.relativize(file).toString();
                            String binaryName = relativePath.substring(0, relativePath.length() - 6).replace('/', '.');
                            int packageDot = binaryName.lastIndexOf('.');
                            if (packageDot > (-1)) {
                                packages.add(binaryName.substring(0, packageDot));
                            }
                            String typeName = binaryName.replace('$', '.');
                            addClassName2Map(classSimpleName2FQN, typeName);
                        }
                        return FileVisitResult.CONTINUE;
                    }
                    @Override
                    public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
                        return FileVisitResult.CONTINUE;
                    }
                    @Override
                    public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
                        depth--;
                        return FileVisitResult.CONTINUE;
                    }
                });
            } catch (IOException ex) {
                proc.debug(ex, "doIndex(" + d.toString() + ")");
            }
        }

        return new ClassIndex(timestamp, originalPath, packages, classSimpleName2FQN);
    }
513854
function remove(path) {
	let files = [];
	if( fs.existsSync(path) ) {
		if(fs.statSync(path).isFile()){
			fs.unlinkSync(path);
			return;
		}

		files = fs.readdirSync(path);
		files.forEach(function(file, index){
			let curPath = path + "/" + file;
			if(fs.statSync(curPath).isDirectory()) {
				remove(curPath)
			} else {
				fs.unlinkSync(curPath);
			}
		});
		fs.rmdirSync(path, err=>console.error(err));
	}
}
297743
function (filePath) {
                    var
                        me = this,
                        extName = _path.extname(filePath).toLowerCase(),
                        size,
                        stream;
                    _fs.stat(filePath, function (err, stats) {
                        var mimeType;
                        if (err) {
                            me._response.plain(500,
                                "Unable to access file (" + err + ")");
                            return;
                        }
                        if (stats.isDirectory()) {
                            me._response.plain(200, "Directory.");
                            return;
                        } else if (!stats.isFile()) {
                            me._response.plain(200, "Not a file.");
                            return;
                        }
                        size = stats.size;
                        mimeType = gpf.http.getMimeType(extName);
                        if (me._options.verbose) {
                            console.log("\tMime type  : " + mimeType);
                            console.log("\tFile size  : " + size);
                        }
                        me._response.writeHead(200, {
                            "content-type": mimeType,
                            "content-length": size
                        });
                        stream = _fs.createReadStream(filePath);
                        //stream.on("data", function (chunk) {
                        //    if (!me._response.write(chunk)) {
                        //        stream.pause();
                        //        me._response.once("drain", function () {
                        //            stream.resume();
                        //        });
                        //    }
                        //});
                        stream.on("end", function () {
                            if (me._options.verbose) {
                                console.log("\tEnd      t+: "
                                + ((new Date()) - me._startTimeStamp)
                                + "ms");
                            }
                            me._response.statusCode = 200;
                            me._response.end();
                        });
                        stream.pipe(me._response);
                    });
                }
1291162
public function clearTimestamps()
    {
        $path = $this->path . static::BUILD_TIME_FILE;
        if (file_exists($path)) {
            unlink($this->path . static::BUILD_TIME_FILE);
        }
    }
1060866
function (filepath) {

            // console.log('processing: ' + filepath);

            // read file source, saved in RAM
            var content = grunt.file.read(filepath);

            /*
             * Reset pattern's last search index to 0
             * at the beginning for each file content.
             *
             * NOTE:
             *   Since the pattern is always the same regex instance,
             *   property 'lastIndex' changes each time when .exec() is performed.
             *   To avoid 'lastIndex' affected by recursive function call,
             *   its value MUST be cached for each file content.
             */
            var cacheLastIndex = 0;
            _.pattern.lastIndex = cacheLastIndex;
            var matches = _.pattern.exec(content);
            cacheLastIndex = _.pattern.lastIndex;

            // While there are matches (of import-links) in file content
            while (matches !== null) {

                /*
                 * Construct the imported file's absolute path
                 *   (doesn't matter whether or not a relative path),
                 * and recursively search in imported file. (dept-first)
                 *
                 * NOTE:
                 *    - the regex uses capture group, the first match is the fragment file path.
                 */
                var currentDir = path.dirname(filepath),
                    relativeFilepath = matches[1].trim(),
                    importedFilepath = path.resolve(currentDir, relativeFilepath);

                var returnContent = getReplacedFileContent(importedFilepath);


                /*
                 * For current file content,
                 * replace import-link tag with return value.
                 *
                 * NOTE:
                 *   Because of dept-first search,
                 *   should ONLY replace the first match in current content.
                 *   rather than search globally.
                 */
                content = content.replace(_.patternNonGlobal, returnContent);
                // console.log(content);
                // console.log(matches);
                // console.log('-----');


                /*
                 * Keep searching in current file.
                 *
                 * NOTE:
                 *   After replacing part of the content (the step above),
                 *   the content's length changes accordingly.
                 *   Thus the 'lastIndex' property should shift to
                 *   the proper position to ensure next search.
                 */
                var deltaLength = returnContent.length - matches[0].length;

                _.pattern.lastIndex = cacheLastIndex + deltaLength;
                matches = _.pattern.exec(content);
                cacheLastIndex = _.pattern.lastIndex;
            }

            // When searching and replacing is done, return the result.
            return content;
        }
1001351
@SuppressWarnings("unchecked")
    public <A extends Comparable<?>> DateTimePath<A> get(DateTimePath<A> path) {
        DateTimePath<A> newPath = getDateTime(toString(path), (Class<A>) path.getType());
        return addMetadataOf(newPath, path);
    }