This repository has been archived by the owner on Feb 9, 2018. It is now read-only.
/
ProcessWrapper.java
64 lines (57 loc) · 2.12 KB
/
ProcessWrapper.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* PS3 Media Server, for streaming any medias to your PS3.
* Copyright (C) 2008 A.Brochard
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package net.pms.io;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
* Wrapper for executing a command line process while keeping an eye on it from PMS.
*/
public interface ProcessWrapper extends UnusedProcess {
/**
* Retrieves the input stream generated by the command line process.
*
* @param seek Number of bytes to skip in the input stream.
* @return The input stream coming from the process.
* @throws IOException
*/
public InputStream getInputStream(long seek) throws IOException;
public List<String> getResults();
/**
* Returns whether or not there still is an underlying process to destroy.
* Will return <code>true</code> if the underlying process has been
* destroyed already.
*
* @return <code>true</code> if the process has already been destroyed,
* <code>false</code> otherwise.
*/
public boolean isDestroyed();
/**
* Starts the underlying command line process in a new thread. This means
* that the process will run in parallel with the current thread and that
* the current thread will not be blocked by its execution.
*/
public void runInNewThread();
/**
* Starts the underlying command line process in the same thread as the
* current thread. This means that the current thread will block until
* the execution of the process is finished.
*/
public void runInSameThread();
}