Create video device from file.

@param file the video descriptor file
@return The {@link VideoDevice}
510041
private static VideoDevice getVideoDevice(File file) {

		LOG.debug("Creating V4L4J device from file {}", file);

		try {
			return new VideoDevice(file.getAbsolutePath());
		} catch (V4L4JException e) {
			throw new WebcamException("Cannot instantiate V4L4J device from " + file, e);
		}
	}
148534
public static VideoHelper newInstance(final SecurityContext securityContext, final VideoFile inputVideo) {
		return newInstance(securityContext, inputVideo, null);
	}
623416
public static Writer newBufferedUTF8FileWriter(final String file) throws UnsupportedEncodingException, FileNotFoundException {
        return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
    }
459497
public static InputStream openFile(File file) throws RuntimeIOException {
    try {
      InputStream is = new BufferedInputStream(new FileInputStream(file));
      if (file.getName().endsWith(".gz")) {
        is = new GZIPInputStream(is);
      }
      return is;
    } catch (Exception e) {
      throw new RuntimeIOException(e);
    }
  }
949927
def create_video(self):
        """"""

        self.instance = vlc.Instance()

        video_widget = QFrame()
        self.mediaplayer = self.instance.media_player_new()
        if system() == 'Linux':
            self.mediaplayer.set_xwindow(video_widget.winId())
        elif system() == 'Windows':
            self.mediaplayer.set_hwnd(video_widget.winId())
        elif system() == 'darwin':  # to test
            self.mediaplayer.set_nsobject(video_widget.winId())
        else:
            lg.warning('unsupported system for video widget')
            return

        self.medialistplayer = vlc.MediaListPlayer()
        self.medialistplayer.set_media_player(self.mediaplayer)
        event_manager = self.medialistplayer.event_manager()
        event_manager.event_attach(vlc.EventType.MediaListPlayerNextItemSet,
                                   self.next_video)

        self.idx_button = QPushButton()
        self.idx_button.setText('Start')
        self.idx_button.clicked.connect(self.start_stop_video)

        layout = QVBoxLayout()
        layout.addWidget(video_widget)
        layout.addWidget(self.idx_button)
        self.setLayout(layout)
519048
public static Properties fromFile(
    final File file)
    throws IOException
  {
    Objects.requireNonNull(file, "File");

    try (InputStream stream = Files.newInputStream(file.toPath())) {
      final Properties p = new Properties();
      p.load(stream);
      return p;
    }
  }
1049579
protected OutputStream createFileOutputStream(File file) {
    try {
      return new FileOutputStream(file);
    } catch (FileNotFoundException e) {
      throw new GenException(Message.DOMAGEN9001, e, e);
    }
  }
130301
public static Map<String, IDLProxyObject> create(File file) throws IOException {
        return create(file, false);
    }
1266871
public static Intent photoCapture(String file) {
        Uri uri = Uri.fromFile(new File(file));
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
        return intent;
    }
53859
public static OutputStream outputStream(File file) {
        try {
            return new FileOutputStream(file);
        } catch (FileNotFoundException e) {
            throw E.ioException(e);
        }
    }
1072433
public OdsFileWriterAdapter createWriterAdapter(final File file) throws IOException {
        final NamedOdsDocument document = this.createNamedDocument();
        final ZipUTF8WriterBuilder zipUTF8Writer = ZipUTF8WriterImpl.builder().noWriterBuffer();
        final OdsFileWriterAdapter writerAdapter = OdsFileWriterAdapter
                .create(OdsFileDirectWriter.builder(this.logger, document)
                        .openResult(this.openFile(file)).zipBuilder(zipUTF8Writer).build());
        document.addObserver(writerAdapter);
        document.prepareFlush();
        return writerAdapter;
    }
694066
AvroYarnJobSubmissionParameters fromFile(final File file) throws IOException {
    try (final FileInputStream fileInputStream = new FileInputStream(file)) {
      // This is mainly a test hook.
      return fromInputStream(fileInputStream);
    }
  }
257012
private Media create(String prefix, int prefixLength, File file)
    {
        final String currentPath = file.getPath();
        final String[] systemPath = SLASH.split(currentPath.substring(currentPath.indexOf(prefix) + prefixLength)
                                                           .replace(File.separator, Constant.SLASH));
        final Media media;
        if (loader.isPresent())
        {
            media = new MediaDefault(separator, loader.get(), UtilFolder.getPathSeparator(separator, systemPath));
        }
        else
        {
            media = new MediaDefault(separator, resourcesDir, UtilFolder.getPathSeparator(separator, systemPath));
        }
        return media;
    }
18086
public static @NonNull ClickEvent openFile(final @NonNull String file) {
    return new ClickEvent(Action.OPEN_FILE, file);
  }
1074576
public static PemObject getPemObject(final File file) throws IOException
	{
		PemObject pemObject;
		try (PemReader pemReader = new PemReader(new InputStreamReader(new FileInputStream(file))))
		{
			pemObject = pemReader.readPemObject();
		}
		return pemObject;
	}
1343831
public static InputStream inputStream(File file) {
        // workaround http://stackoverflow.com/questions/36880692/java-file-does-not-exists-but-file-getabsolutefile-exists
        if (!file.exists()) {
            file = file.getAbsoluteFile();
        }
        if (!file.exists()) {
            throw E.ioException("File does not exists: %s", file.getPath());
        }
        try {
            return new FileInputStream(file);
        } catch (FileNotFoundException e) {
            throw E.ioException(e);
        }
    }
1126190
public static File createRandomFile(MultipartFile file) {
        String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(file.getContentType().toString());
        if (StringUtils.isEmpty(extension)) {
            extension = MimeTypeMap.getFileExtensionFromUrl(file.getFilename());
        }
        String uuid = UUID.randomUUID().toString();
        return new File(App.getInstance().getRootDir(), uuid + "." + extension);
    }