Returns the stat information about the file.
@throws FileNotFoundException if the file does not exist.
516234
public FileStatus getFileStatus(Path f) throws IOException {
    FileStatus fi = dfs.getFileInfo(getPathName(f));
    if (fi != null) {
      fi.makeQualified(this);
      return fi;
    } else {
      throw new FileNotFoundException("File does not exist: " + f);
    }
  }
98723
@Override
	public FileBaseStatistics getStatistics(BaseStatistics cachedStats) throws IOException {
		final FileBaseStatistics stats = super.getStatistics(cachedStats);
		return stats == null ? null : 
			new FileBaseStatistics(stats.getLastModificationTime(), stats.getTotalInputSize(), this.recordLength);
	}
855783
@Override
  public FileStatus getFileStatus(Path hadoopPath)
      throws IOException {

    long startTime = System.nanoTime();
    Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");

    checkOpen();

    logger.atFine().log("GHFS.getFileStatus: %s", hadoopPath);
    URI gcsPath = getGcsPath(hadoopPath);
    FileInfo fileInfo = getGcsFs().getFileInfo(gcsPath);
    if (!fileInfo.exists()) {
      logger.atFine().log("GHFS.getFileStatus: not found: %s", gcsPath);
      throw new FileNotFoundException(
          (fileInfo.isDirectory() ? "Directory not found : " : "File not found : ") + hadoopPath);
    }
    String userName = getUgiUserName();
    FileStatus status = getFileStatus(fileInfo, userName);

    long duration = System.nanoTime() - startTime;
    increment(Counter.GET_FILE_STATUS);
    increment(Counter.GET_FILE_STATUS_TIME, duration);
    return status;
  }
272695
public function stream_stat()
    {

        try {
            $file = $this->currentlyOpenedFile->getFile();

            return array_merge($this->getStatArray(), array(
                'mode' => $file->mode(),
                'uid' => $file->user(),
                'gid' => $file->group(),
                'atime' => $file->atime(),
                'mtime' => $file->mtime(),
                'ctime' => $file->ctime(),
                'size' => $file->size()
            ));
        } catch (NotFoundException $e) {
            return false;
        }
    }
1052144
def GetStat(self):
    
    if self._stat_object is None:
      self._stat_object = self._GetStat()
    return self._stat_object
1337520
def _GetStat(self):
    
    stat_object = super(FakeFileEntry, self)._GetStat()

    location = getattr(self.path_spec, 'location', None)
    if location:
      file_data = self._file_system.GetDataByPath(location)

      if file_data is not None:
        stat_object.size = len(file_data)

    return stat_object
198131
def _GetStat(self):
    
    stat_object = super(TSKFileEntry, self)._GetStat()

    # File data stat information.
    stat_object.size = getattr(self._tsk_file.info.meta, 'size', None)

    # Date and time stat information.
    stat_time, stat_time_nano = self._TSKFileTimeCopyToStatTimeTuple(
        self._tsk_file, 'bkup')
    if stat_time is not None:
      stat_object.bkup = stat_time
      stat_object.bkup_nano = stat_time_nano

    stat_time, stat_time_nano = self._TSKFileTimeCopyToStatTimeTuple(
        self._tsk_file, 'dtime')
    if stat_time is not None:
      stat_object.dtime = stat_time
      stat_object.dtime_nano = stat_time_nano

    # Ownership and permissions stat information.
    mode = getattr(self._tsk_file.info.meta, 'mode', None)
    if mode is not None:
      # We need to cast mode to an int since it is of type
      # pytsk3.TSK_FS_META_MODE_ENUM.
      stat_object.mode = int(mode)

    stat_object.uid = getattr(self._tsk_file.info.meta, 'uid', None)
    stat_object.gid = getattr(self._tsk_file.info.meta, 'gid', None)

    # File entry type stat information.

    # Other stat information.
    stat_object.ino = getattr(self._tsk_file.info.meta, 'addr', None)
    # stat_object.dev = stat_info.st_dev
    # stat_object.nlink = getattr(self._tsk_file.info.meta, 'nlink', None)
    # stat_object.fs_type = 'Unknown'

    flags = getattr(self._tsk_file.info.meta, 'flags', 0)

    # The flags are an instance of pytsk3.TSK_FS_META_FLAG_ENUM.
    stat_object.is_allocated = bool(int(flags) & pytsk3.TSK_FS_META_FLAG_ALLOC)

    return stat_object
784447
public FileInfo getFileInfo() throws IOException {

        try {
            load(false);
            if (m_resource.isFile()) {

                //  Fill in a file information object for this file/directory

                long flen = m_resource.getLength();

                //long alloc = (flen + 512L) & 0xFFFFFFFFFFFFFE00L;
                long alloc = flen;
                int fattr = 0;
                if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()) {
                    fattr += FileAttribute.ReadOnly;
                }
                //  Create the file information
                FileInfo finfo = new FileInfo(m_resource.getName(), flen, fattr);
                long fdate = m_resource.getDateLastModified();
                finfo.setModifyDateTime(fdate);
                finfo.setAllocationSize(alloc);
                finfo.setFileId(m_resource.getStructureId().hashCode());
                finfo.setCreationDateTime(m_resource.getDateCreated());
                finfo.setChangeDateTime(fdate);
                return finfo;
            } else {

                //  Fill in a file information object for this directory

                int fattr = FileAttribute.Directory;
                if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()) {
                    fattr += FileAttribute.ReadOnly;
                }
                // Can't use negative file size here, since this stops Windows 7 from connecting
                FileInfo finfo = new FileInfo(m_resource.getName(), 1, fattr);
                long fdate = m_resource.getDateLastModified();
                finfo.setModifyDateTime(fdate);
                finfo.setAllocationSize(1);
                finfo.setFileId(m_resource.getStructureId().hashCode());
                finfo.setCreationDateTime(m_resource.getDateCreated());
                finfo.setChangeDateTime(fdate);
                return finfo;

            }
        } catch (CmsException e) {
            throw CmsJlanDiskInterface.convertCmsException(e);

        }
    }
545934
public function size($filename)
    {
        if ($this->exists($filename) && $this->isFile($filename)) {
            return filesize($filename);
        }
        throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].');
    }
188638
public File getFile() throws FileNotFoundException {
        URL url = this.getUrl();

        if (isJarURL(url)) {
            /*
                This is actually request for file, that's packed into jar. Probably the current one, but that doesn't matters.
             */
            try {
                url = extractActualUrl(url);
                File file = File.createTempFile("canova_temp", "file");
                file.deleteOnExit();

                ZipFile zipFile = new ZipFile(url.getFile());
                ZipEntry entry = zipFile.getEntry(this.resourceName);
                if (entry == null) {
                    if (this.resourceName.startsWith("/")) {
                        entry = zipFile.getEntry(this.resourceName.replaceFirst("/", ""));
                        if (entry == null) {
                            throw new FileNotFoundException("Resource " + this.resourceName + " not found");
                        }
                    } else
                        throw new FileNotFoundException("Resource " + this.resourceName + " not found");
                }

                long size = entry.getSize();

                InputStream stream = zipFile.getInputStream(entry);
                FileOutputStream outputStream = new FileOutputStream(file);
                byte[] array = new byte[1024];
                int rd = 0;
                long bytesRead = 0;
                do {
                    rd = stream.read(array);
                    outputStream.write(array, 0, rd);
                    bytesRead += rd;
                } while (bytesRead < size);

                outputStream.flush();
                outputStream.close();

                stream.close();
                zipFile.close();

                return file;
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

        } else {
            /*
                It's something in the actual underlying filesystem, so we can just go for it
             */

            try {
                URI uri = new URI(url.toString().replaceAll(" ", "%20"));
                return new File(uri.getSchemeSpecificPart());
            } catch (URISyntaxException e) {
                return new File(url.getFile());
            }
        }
    }
277253
@Override
	public FileBaseStatistics getStatistics(BaseStatistics cachedStats) throws IOException {
		
		final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats instanceof FileBaseStatistics) ?
			(FileBaseStatistics) cachedStats : null;
				
		try {
			final Path path = this.filePath;
			final FileSystem fs = FileSystem.get(path.toUri());
			
			return getFileStats(cachedFileStats, path, fs, new ArrayList<FileStatus>(1));
		} catch (IOException ioex) {
			if (LOG.isWarnEnabled()) {
				LOG.warn("Could not determine statistics for file '" + this.filePath + "' due to an io error: "
						+ ioex.getMessage());
			}
		}
		catch (Throwable t) {
			if (LOG.isErrorEnabled()) {
				LOG.error("Unexpected problen while getting the file statistics for file '" + this.filePath + "': "
						+ t.getMessage(), t);
			}
		}
		
		// no statistics available
		return null;
	}
1164103
public function generate()
    {
        if (false === file_exists($this->filename) || false === is_file($this->filename)) {
            throw new FileNotFoundException(sprintf('The file "%s" does not exist.', $this->filename));
        }

        $json = Json::decode(file_get_contents($this->filename), true);

        for ($i = 0; $i < count($json); $i++) {
            $json[$i] = $this->filterByKey($json[$i], function ($key, $value) {
                return null === $this->parameters || true === in_array($key, $this->parameters);
            });
        }

        return array_filter($json, function ($value) {
            return count($value) > 0;
        });
    }
818611
public void dumpStats(final String file) throws FileNotFoundException {
		PrintStream out = null;
		try {
			out = new PrintStream(new FileOutputStream(file));
			dumpStats(out);
		} finally {
			try {
				out.close();
			} catch (Exception ign) {
			}
		}
	}
24010
public function getMetadata()
    {
        try {
            $path = $this->getPrefix();
            if ($this->getFileSystem()->has($path)) {
                return $this->getFileSystem()->get($path)->getMetadata();
            }

        } catch (FileNotFoundException $e) {
        }
        return false;
    }
166861
public function stream_stat()
    {
        $statistics = $this->fileStatisticsTemplate();

        if ($this->_download !== null) {
            $statistics[7] = $statistics['size'] = $this->_download->getSize();
        }
        if ($this->_upload !== null) {
            $statistics[7] = $statistics['size'] = $this->_pointerOffset;
        }

        return $statistics;
    }
549889
def _GetStat(self):
    
    stat_object = vfs_stat.VFSStat()

    # File data stat information.
    stat_object.size = self.path_spec.range_size

    # File entry type stat information.
    stat_object.type = stat_object.TYPE_FILE

    return stat_object
940613
public function stat(): array
    {
        $result = fstat($this->handle);

        if (false === $result) {
            $message = 'Could not stat file.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return $result;
    }