Package aQute.libg.remote.source
Class RemoteSource
- java.lang.Object
-
- aQute.libg.remote.source.RemoteSource
-
- All Implemented Interfaces:
Source
public class RemoteSource extends java.lang.Object implements Source
Controls a different file system trough a Sink. It can translate files with local absolute file paths to remote absolute file paths (also if it is a windows system). It also detects changes in the local file system and will update the remote. Updates are checked for SHAs so we only transfer the files when they really are not there, even allowing a remote SHA cache to do its magic.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringareaId(package private) java.io.Filecwd(package private) SourceFSfsync(package private) java.util.concurrent.atomic.AtomicBooleanrunningprivate Sinksinkprivate java.lang.Appendablestderrprivate java.lang.Appendablestdoutprivate java.lang.Threadthread(package private) Welcomewelcome
-
Constructor Summary
Constructors Constructor Description RemoteSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.io.File file)voidcancel()voidclose()Closevoidevent(Event e, Area area)private voidexit()byte[]getData(java.lang.String sha)Called from the remote sink to get the data when it lacks the given sha.SinkgetSink()voidjoin()voidlaunch(java.util.Map<java.lang.String,java.lang.String> env, java.util.List<java.lang.String> args, java.io.InputStream stdin, java.lang.Appendable stdout, java.lang.Appendable stderr)voidopen(Sink sink, java.io.File cwd, java.lang.String areaId)voidoutput(java.lang.String areaId, java.lang.CharSequence text, boolean err)voidsync()voidupdate(java.io.File f)
-
-
-
Field Detail
-
sink
private Sink sink
-
stdout
private java.lang.Appendable stdout
-
stderr
private java.lang.Appendable stderr
-
thread
private java.lang.Thread thread
-
running
volatile java.util.concurrent.atomic.AtomicBoolean running
-
welcome
Welcome welcome
-
fsync
SourceFS fsync
-
areaId
java.lang.String areaId
-
cwd
java.io.File cwd
-
-
Method Detail
-
open
public void open(Sink sink, java.io.File cwd, java.lang.String areaId)
-
getData
public byte[] getData(java.lang.String sha) throws java.lang.ExceptionCalled from the remote sink to get the data when it lacks the given sha.
-
close
public void close() throws java.io.IOExceptionClose- Throws:
java.io.IOException
-
exit
private void exit()
-
output
public void output(java.lang.String areaId, java.lang.CharSequence text, boolean err) throws java.io.IOException
-
getSink
public Sink getSink()
-
launch
public void launch(java.util.Map<java.lang.String,java.lang.String> env, java.util.List<java.lang.String> args, java.io.InputStream stdin, java.lang.Appendable stdout, java.lang.Appendable stderr) throws java.lang.Exception- Throws:
java.lang.Exception
-
cancel
public void cancel() throws java.lang.Exception- Throws:
java.lang.Exception
-
update
public void update(java.io.File f) throws java.lang.Exception- Throws:
java.lang.Exception
-
sync
public void sync() throws java.lang.Exception- Throws:
java.lang.Exception
-
add
public void add(java.io.File file) throws java.lang.Exception- Throws:
java.lang.Exception
-
join
public void join() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
-