|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.utils.RUtils
public class RUtils
This is a collection of various silly things you can do when accessing
Rserve.
This class is based on an implementation of Andreas Stephanik and was further
developed by Jens Keilwagen.
REnvironment
Constructor Summary | |
---|---|
RUtils()
|
Method Summary | |
---|---|
static int |
copyFileFromServer(String sourcePath,
OutputStream out,
RConnection c)
Pipes a RFileInputStream of the given sourcePath into the given OutputStream out |
static int |
copyFileFromServer(String sourcePath,
String targetPath,
RConnection c)
This method copies a file from the server to the client. |
static void |
copyFileToServer(File source,
String targetName,
RConnection rconnection)
Copies a file to the R side. |
static void |
copyFileToServer(String sourcePath,
String targetName,
RConnection rconnection)
Copies a file to the R side. |
static void |
installRScript(String sourcePath,
String targetName,
RConnection rconnection)
Installs an R script on the Rserve server. |
static RConnection |
openRConnection(String rServeHostName,
String loginName,
String passwd)
This method opens an RConnection . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RUtils()
Method Detail |
---|
public static void installRScript(String sourcePath, String targetName, RConnection rconnection) throws Exception
RConnection.removeFile(String targetname)
at the end of your
session.
sourcePath
- path of your R script on your local box, this script will be
copied to the Rserve server (e.g. pdw-24 /tmp/Rserve/conn*)targetName
- just the desired name of the R script on the Rserve server
(mostly the same as on local box, but without path
delimiters!), should not contain any path delimiters, since
Rserve may restrict the access to local working directoryrconnection
- an already open connection to the Rserve server
Exception
- if something went wrong while installing the R script on the
Rserve serverpublic static void copyFileToServer(File source, String targetName, RConnection rconnection) throws Exception
source
- the source filetargetName
- should not contain any path delimiters, since Rserve may
restrict the access to local working directoryrconnection
- the connection to R
Exception
- if something went wrong while copying the filepublic static void copyFileToServer(String sourcePath, String targetName, RConnection rconnection) throws Exception
sourcePath
- the source pathtargetName
- should not contain any path delimiters, since Rserve may
restrict the access to local working directoryrconnection
- the connection to R
Exception
- if something went wrong while copying the filecopyFileToServer(File, String, RConnection)
public static int copyFileFromServer(String sourcePath, String targetPath, RConnection c) throws IOException
sourcePath
- the server path nametargetPath
- the client path namec
- the connection to R
IOException
- if the file could not be copiedpublic static int copyFileFromServer(String sourcePath, OutputStream out, RConnection c) throws IOException
RFileInputStream
of the given sourcePath
into the given OutputStream
out
sourcePath
- the server path nameout
- the stream which is used to write the contentc
- the connection to R
IOException
- if the file could not be copiedpublic static RConnection openRConnection(String rServeHostName, String loginName, String passwd) throws Exception
RConnection
.
rServeHostName
- the name of the server with RServeloginName
- the login (if needed)passwd
- the password (if needed)
Exception
- if no connection could be established
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |