public class RUtils extends Object
REnvironment
Constructor and Description |
---|
RUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
copyFileFromServer(String sourcePath,
OutputStream out,
RConnection c)
|
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 . |
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 serverException
- 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 RException
- 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 RException
- 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 RIOException
- if the file could not be copiedpublic static int copyFileFromServer(String sourcePath, OutputStream out, RConnection c) throws IOException
sourcePath
- the server path nameout
- the stream which is used to write the contentc
- the connection to RIOException
- 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