@Test public void testSrtMustBeReadable() throws Exception { doThrow(new NoSuchFileException(null)).when(provider).checkAccess(srt, AccessMode.READ); exception.expect(NoSuchFileException.class); muxer.start(); }
public void start() throws IOException { if (state.compareAndSet(NOT_STARTED, RUNNING)) { try { access(mkv, AccessMode.READ); access(srt, AccessMode.READ); access(tempDir, AccessMode.WRITE); output.toFile().deleteOnExit(); ProcessBuilder builder = factory.from("mkvmerge", "-o", output.toString(), mkv.toString(), srt.toString()); builder.directory(tempDir.toFile()).inheritIO(); process = builder.start(); } catch (Exception e) { state.set(FAILED); deleteWarn(output); throw e; } } }
Muxer { public void start() throws IOException { if (state.compareAndSet(NOT_STARTED, RUNNING)) { try { access(mkv, AccessMode.READ); access(srt, AccessMode.READ); access(tempDir, AccessMode.WRITE); output.toFile().deleteOnExit(); ProcessBuilder builder = factory.from("mkvmerge", "-o", output.toString(), mkv.toString(), srt.toString()); builder.directory(tempDir.toFile()).inheritIO(); process = builder.start(); } catch (Exception e) { state.set(FAILED); deleteWarn(output); throw e; } } } }
Muxer { public void start() throws IOException { if (state.compareAndSet(NOT_STARTED, RUNNING)) { try { access(mkv, AccessMode.READ); access(srt, AccessMode.READ); access(tempDir, AccessMode.WRITE); output.toFile().deleteOnExit(); ProcessBuilder builder = factory.from("mkvmerge", "-o", output.toString(), mkv.toString(), srt.toString()); builder.directory(tempDir.toFile()).inheritIO(); process = builder.start(); } catch (Exception e) { state.set(FAILED); deleteWarn(output); throw e; } } } private  Muxer(Path mkv, Path srt, Path tempDir, ProcessBuilderFactory factory, Sleeper sleeper); }
Muxer { public void start() throws IOException { if (state.compareAndSet(NOT_STARTED, RUNNING)) { try { access(mkv, AccessMode.READ); access(srt, AccessMode.READ); access(tempDir, AccessMode.WRITE); output.toFile().deleteOnExit(); ProcessBuilder builder = factory.from("mkvmerge", "-o", output.toString(), mkv.toString(), srt.toString()); builder.directory(tempDir.toFile()).inheritIO(); process = builder.start(); } catch (Exception e) { state.set(FAILED); deleteWarn(output); throw e; } } } private  Muxer(Path mkv, Path srt, Path tempDir, ProcessBuilderFactory factory, Sleeper sleeper); static Muxer of(Path mkv, Path srt, Path tempDir); void start(); State state(); int waitFor(); boolean waitFor(long timeout, TimeUnit unit); Optional<Path> getOutput(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); Path getMkv(); boolean waitForOutput(); }
Muxer { public void start() throws IOException { if (state.compareAndSet(NOT_STARTED, RUNNING)) { try { access(mkv, AccessMode.READ); access(srt, AccessMode.READ); access(tempDir, AccessMode.WRITE); output.toFile().deleteOnExit(); ProcessBuilder builder = factory.from("mkvmerge", "-o", output.toString(), mkv.toString(), srt.toString()); builder.directory(tempDir.toFile()).inheritIO(); process = builder.start(); } catch (Exception e) { state.set(FAILED); deleteWarn(output); throw e; } } } private  Muxer(Path mkv, Path srt, Path tempDir, ProcessBuilderFactory factory, Sleeper sleeper); static Muxer of(Path mkv, Path srt, Path tempDir); void start(); State state(); int waitFor(); boolean waitFor(long timeout, TimeUnit unit); Optional<Path> getOutput(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); Path getMkv(); boolean waitForOutput();  }