Package org.jenkinsci.plugins.p4.scm
Class P4SCMFile
- java.lang.Object
-
- jenkins.scm.api.SCMFile
-
- org.jenkinsci.plugins.p4.scm.P4SCMFile
-
public class P4SCMFile extends jenkins.scm.api.SCMFile
-
-
Constructor Summary
Constructors Constructor Description P4SCMFile(P4SCMFileSystem fs)
P4SCMFile(P4SCMFileSystem fs, P4SCMFile parent, String name, boolean isDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<jenkins.scm.api.SCMFile>
children()
If this object represents a directory, lists up all the immediate children.InputStream
content()
Reads the content of this file.long
lastModified()
Returns the time that theSCMFile
was last modified.protected jenkins.scm.api.SCMFile
newChild(String name, boolean assumeIsDirectory)
protected jenkins.scm.api.SCMFile.Type
type()
The type of this object.
-
-
-
Constructor Detail
-
P4SCMFile
public P4SCMFile(P4SCMFileSystem fs)
-
P4SCMFile
public P4SCMFile(P4SCMFileSystem fs, @NonNull P4SCMFile parent, String name, boolean isDir)
-
-
Method Detail
-
newChild
protected jenkins.scm.api.SCMFile newChild(@NonNull String name, boolean assumeIsDirectory)
- Specified by:
newChild
in classjenkins.scm.api.SCMFile
-
children
public Iterable<jenkins.scm.api.SCMFile> children() throws IOException, InterruptedException
If this object represents a directory, lists up all the immediate children.- Specified by:
children
in classjenkins.scm.api.SCMFile
- Returns:
- Always non-null. If this method is not a directory, this method returns an empty iterable.
- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if interrupted while performing the operation.
-
lastModified
public long lastModified() throws IOException, InterruptedException
Returns the time that theSCMFile
was last modified.- Specified by:
lastModified
in classjenkins.scm.api.SCMFile
- Returns:
- A
long
value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970) or0L
if the operation is unsupported. - Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if interrupted while performing the operation.
-
type
protected jenkins.scm.api.SCMFile.Type type() throws IOException, InterruptedException
The type of this object.- Specified by:
type
in classjenkins.scm.api.SCMFile
- Returns:
- the
SCMFile.Type
of this object, specificallySCMFile.Type.NONEXISTENT
if thisSCMFile
instance does not exist in the remote system (e.g. if you created a nonexistent instance viaSCMFile.child(String)
) - Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if interrupted while performing the operation.- Since:
- 2.0
-
content
public InputStream content() throws IOException, InterruptedException
Reads the content of this file.- Specified by:
content
in classjenkins.scm.api.SCMFile
- Returns:
- an open stream to read the file content. The caller must close the stream.
- Throws:
IOException
- if this object represents a directory or if an error occurs while performing the operation.InterruptedException
- if interrupted while performing the operation.
-
-