Get a file from the filesystem. Returns a SimFile or None.
339798
def get(self, path):
        
        mountpoint, chunks = self.get_mountpoint(path)

        if mountpoint is None:
            return self._files.get(self._join_chunks(chunks))
        else:
            return mountpoint.get(chunks)
1153396
public File getFile(String fileName) throws IOException {
    validatePathname(fileName);

    String pathname = storageDir + separator + fileName;

    File file = new File(pathname);
    if (!file.exists()) {
      throw new FileNotFoundException(pathname);
    }
    if (!file.isFile()) {
      throw new IOException('\'' + pathname + '\'' + " is not a file");
    }
    return file;
  }
635964
def __getFileObj(self, f):
        """"""
        if not f:
            raise ShapefileException("No file-like object available.")
        elif hasattr(f, "write"):
            return f
        else:
            pth = os.path.split(f)[0]
            if pth and not os.path.exists(pth):
                os.makedirs(pth)
            return open(f, "wb+")
786588
@Override
    File getFile() {
        if (logicalZipFile != null) {
            return logicalZipFile.getPhysicalFile();
        } else {
            // Not performing a full scan (only getting classpath elements), so logicalZipFile is not set
            final int plingIdx = rawPath.indexOf('!');
            final String outermostZipFilePathResolved = FastPathResolver.resolve(FileUtils.CURR_DIR_PATH,
                    plingIdx < 0 ? rawPath : rawPath.substring(0, plingIdx));
            return new File(outermostZipFilePathResolved);
        }
    }
420836
def _get_fs(self, create_dir=True):
        """"""
        filedir = dirname(self.fileurl)
        filename = basename(self.fileurl)

        return (
            opener.opendir(filedir, writeable=True, create_dir=create_dir),
            filename
        )
1227312
def getFile(self, name, relative=None):
        
        if self.pathCallback is not None:
            return getFile(self._getFileDeprecated(name, relative))
        return getFile(name, relative or self.pathDirectory)
1126166
def get_file(filename):
    ''''''
    destination = __DOWNLOAD_PARAMS['path']
    filepath = os.path.join(destination, filename)

    if not __is_current(filepath):

        if not os.path.exists(destination):
            os.makedirs(destination)

        url = 'ftp://ftp.ebi.ac.uk/pub/databases/chebi/' + \
            'Flat_file_tab_delimited/'
        urlretrieve(urlparse.urljoin(url, filename), filepath)
        urlcleanup()

    if filepath.endswith('.zip'):
        zfile = zipfile.ZipFile(filepath, 'r')
        filepath = os.path.join(destination, zfile.namelist()[0])
        zfile.extractall(destination)
    elif filepath.endswith('.gz'):
        unzipped_filepath = filepath[:-len('.gz')]

        if os.path.exists(unzipped_filepath) \
                and __is_current(unzipped_filepath):
            filepath = unzipped_filepath
        else:
            input_file = gzip.open(filepath, 'rb')
            filepath = os.path.join(destination, input_file.name[:-len('.gz')])
            output_file = open(filepath, 'wb')

            for line in input_file:
                output_file.write(line)

            input_file.close()
            output_file.close()

    return filepath
1369691
def GetFileObject(self, data_stream_name=''):
    
    if (not data_stream_name and
        not self._fsntfs_file_entry.has_default_data_stream()):
      return None

    # Make sure to make the changes on a copy of the path specification, so we
    # do not alter self.path_spec.
    path_spec = copy.deepcopy(self.path_spec)
    if data_stream_name:
      setattr(path_spec, 'data_stream', data_stream_name)

    return resolver.Resolver.OpenFileObject(
        path_spec, resolver_context=self._resolver_context)
1267050
def get_file(type_str, open_files, basedir):
    """"""
    if type_str not in open_files:
        filename = type_str+".html"
        encoding = 'utf-8'
        fd = codecs.open(os.path.join(basedir, filename), 'w', encoding)
        open_files[type_str] = fd
        write_html_header(fd, type_str, encoding)
    return open_files[type_str]
1138105
def get(name):
    """"""

    filename = find(name)
    if filename is None:
        raise RuntimeError('Could not find %s' % name)
    with open(filename) as fid:
        return fid.read()
63018
def getfile(self, section, option, raw=False, vars=None, fallback="", validate=False):
        
        v = self.get(section, option, raw=raw, vars=vars, fallback=fallback)
        v = self._convert_to_path(v)
        return v if not validate or os.path.isfile(v) else fallback
779108
def _maybe_read_file(filename):
  
  try:
    with open(filename) as infile:
      return infile.read()
  except IOError as e:
    if e.errno == errno.ENOENT:
      return None
226601
def GetFileObjectByPathSpec(self, path_spec):
    
    file_entry = self.GetFileEntryByPathSpec(path_spec)
    if not file_entry:
      return None

    return file_entry.GetFileObject()
908485
def get_fs(path):
    """"""
    scheme = ''
    if '://' in path:
        scheme = path.partition('://')[0]

    for schemes, fs_class in FILE_EXTENSIONS:
        if scheme in schemes:
            return fs_class

    return FileSystem
984033
def _get_sd(file_descr):
        
        for stream_descr in NonBlockingStreamReader._streams:
            if file_descr == stream_descr.stream.fileno():
                return stream_descr
        return None
541763
def get_mime(self, path, isdir):
        ''''''
        if isdir:
            file_type = FOLDER
        else:
            file_type = mimetypes.guess_type(path)[0]
            if not file_type:
                file_type = UNKNOWN
        return file_type
961947
def get(self):
        
        res = self.fs.get_filesystem_details()
        res = res.to_dict()
        self.write(res)