Opens an FSDataInputStream at the indicated Path.

@param f
the file to open
@param options
the read options for this file
552849
public FSDataInputStream open(Path f, ReadOptions options) throws IOException {
    return open(f, getDefaultBufferSize(), options);
  }
13719
protected Spec readSpecFromFile(Path path) throws IOException {
    Spec spec;

    try (FSDataInputStream fis = fs.open(path)) {
      spec = this.specSerDe.deserialize(ByteStreams.toByteArray(fis));
    }

    return spec;
  }
752386
public static FileChannel open(FileDescriptor fd, String path,
                                   boolean readable, boolean writable,
                                   Object parent)
    {
        return new FileChannelImpl(fd, path, readable, writable, false, parent);
    }
1131289
void open() {
        if (askToSave()) {
            return;
        }

        boolean loading = true;
        SaveType fileType;
        tryAgain: while (loading) {
            int value = saveOpenFileChooser.showOpenDialog(mainFrame);
            if (value != JFileChooser.APPROVE_OPTION) {
                return;
            }

            loading = false;
            fileType = convertFilterToType(saveOpenFileChooser.getFileFilter());
            final File f = saveOpenFileChooser.getSelectedFile();

            if (!fileType.isValid(f)) {
                JOptionPane.showMessageDialog(saveOpenFileChooser, "That file is not compatible with the chosen file type",
                        "Invalid File", JOptionPane.WARNING_MESSAGE);
                loading = true;
                continue;
            }

            switch (fileType) {
            case XML_ANALYSIS:
                if (!f.getName().endsWith(".xml")) {
                    JOptionPane.showMessageDialog(saveOpenFileChooser,
                            L10N.getLocalString("dlg.not_xml_data_lbl", "This is not a saved bug XML data file."));
                    loading = true;
                    continue tryAgain;
                }

                if (!mainFrame.openAnalysis(f, fileType)) {
                    // TODO: Deal if something happens when loading analysis
                    JOptionPane.showMessageDialog(saveOpenFileChooser, "An error occurred while trying to load the analysis.");
                    loading = true;
                    continue tryAgain;
                }
                break;
            case FBP_FILE:
                if (!openFBPFile(f)) {
                    // TODO: Deal if something happens when loading analysis
                    JOptionPane.showMessageDialog(saveOpenFileChooser, "An error occurred while trying to load the analysis.");
                    loading = true;
                    continue tryAgain;
                }
                break;
            case FBA_FILE:
                if (!openFBAFile(f)) {
                    // TODO: Deal if something happens when loading analysis
                    JOptionPane.showMessageDialog(saveOpenFileChooser, "An error occurred while trying to load the analysis.");
                    loading = true;
                    continue tryAgain;
                }
                break;
            default:
                assert false;
            }
        }
    }
529963
@GwtIncompatible("Unnecessary")
  private Writer openExternExportsStream(B options, String path) throws IOException {
    if (options.externExportsPath == null) {
      return null;
    }

    String exPath = options.externExportsPath;

    if (!exPath.contains(File.separator)) {
      File outputFile = new File(path);
      exPath = outputFile.getParent() + File.separatorChar + exPath;
    }

    return fileNameToOutputWriter2(exPath);
  }
440250
public <X> DataSource<X> readFile(FileInputFormat<X> inputFormat, String filePath) {
		if (inputFormat == null) {
			throw new IllegalArgumentException("InputFormat must not be null.");
		}
		if (filePath == null) {
			throw new IllegalArgumentException("The file path must not be null.");
		}

		inputFormat.setFilePath(new Path(filePath));
		try {
			return createInput(inputFormat, TypeExtractor.getInputFormatTypes(inputFormat));
		}
		catch (Exception e) {
			throw new InvalidProgramException("The type returned by the input format could not be automatically determined. " +
					"Please specify the TypeInformation of the produced type explicitly by using the " +
					"'createInput(InputFormat, TypeInformation)' method instead.");
		}
	}
594020
private void createDataFile() throws IOException {
        // temporary data file for storage of stream data
        Path path = Paths.get(filePath + ".ser");
        if (Files.deleteIfExists(path)) {
            log.debug("Previous flv data file existed and was removed");
        }
        this.dataChannel = Files.newByteChannel(path, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE, StandardOpenOption.READ);
    }
119713
public void open(InputStream stream) throws IOException
    {

        int size = (int) (stream.available() / UNIT_SIZE);
        _array = new int[size];

        DataInputStream in = null;
        try
        {
            in = new DataInputStream(new BufferedInputStream(
                    stream));
            for (int i = 0; i < size; ++i)
            {
                _array[i] = in.readInt();
            }
        }
        finally
        {
            if (in != null)
            {
                in.close();
            }
        }
    }
439396
public static Map<String, File> loadStringToFileMap(final File f) throws IOException {
    return loadStringToFileMap(Files.asCharSource(f, Charsets.UTF_8));
  }
698934
public void file(java.io.InputStream fp, IoFileRead read) {
        resetCursor();
        io_type = IOType.File;
        if(read == null) {
            read = new IoFileRead.Default();
        }

        io = new JechtIO.File(fp, read);
    }
753105
@Override
	protected InputStream openStream(String path) throws IOException {
		File file = new File(path);
		if (file.isFile() && file.canRead()) {
			return new FileInputStream(path);
		} else {
			return null;
		}
	}
532152
@Override
    public Path toRealPath(final LinkOption... options) throws IOException {
        // All links are "real" (no symlinks) and absolute, so just return this (if exists)
        if (!this.fileSystem.getArchive().contains(this.path)) {
            throw new FileNotFoundException("Path points to a nonexistant file or directory: " + this.toString());
        }
        return this;
    }
634492
@Override
	public void open(FileInputSplit split) throws IOException {
		// read Excel
		super.open(split);
		// infer schema (requires to read file again)
		if (this.customSchema == null) {
			ExcelFlinkFileInputFormat effif = new ExcelFlinkFileInputFormat(this.shocr);
			effif.open(split);
			SpreadSheetCellDAO[] currentRow = effif.nextRecord(null);
			int i = 0;
			while ((currentRow != null) && (i != this.maxInferRows)) {
				this.converter.updateSpreadSheetCellRowToInferSchemaInformation(currentRow);
				i++;
				currentRow = effif.nextRecord(null);
			}
			effif.close();
			this.customSchema = this.converter.getSchemaRow();
		} else {
			this.converter.setSchemaRow(this.customSchema);
		}
	}
434869
@Override
  //@Direct
  public void openWrite(Result<OutputStream> result,
                        WriteOption ...options)
  {
    result.ok(_root.openWriteFile(_path, options));
  }
689057
public void writeToFile(File f) {
		try (FileOutputStream fos = new FileOutputStream(f)) {
			fos.write(write());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
439677
static void open(File dir, String fileName) {
        if (dir.mkdirs() || dir.isDirectory()) {
            File file = new File(dir, fileName);
            try {
                out = new PrintStream(TextFileOutputStreamFactory.createOutputStream(file), true, "UTF-8");
                openedFile = file;
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }
129020
DFSInputStream open(String src, int buffersize, boolean verifyChecksum,
      FileSystem.Statistics stats, boolean clearOsBuffer,
      ReadOptions options
      ) throws IOException {
    checkOpen();

    incFileReadToStats();
    // Get block info from namenode
    DFSInputStream stream = new DFSInputStream(this, src, buffersize,
        verifyChecksum, clearOsBuffer, options);
    if (blockLocationRenewal != null) {
      blockLocationRenewal.add(stream);
    }
    return stream;
  }