|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
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 further
developed by Jens Keilwagen.
Constructor Summary | |
---|---|
RUtils()
|
Method Summary | |
---|---|
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. |
protected static byte[] |
getBytesFromFileOnServer(String sourcePath,
RConnection c)
This method returns the content of a file on the server as byte array. |
static void |
installRScript(String sourcePath,
String targetName,
RConnection rconnection)
Installs an R script on the Rserve server Do not forget to remove the R script by RConnection.removeFile(targetName) at the end of your session. |
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
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
delimeters!). Should not contain any path delimiters, since
Rserve may restrict the access to local working directory.rconnection
- An already open connection to the Rserve server.
Exception
public 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 directory.rconnection
- the connection to R
Exception
- if something went wrong while copyingpublic 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 directory.rconnection
- the connection to R
Exception
- if something went wrong while copyingcopyFileToServer(File, String, RConnection)
public static int copyFileFromServer(String sourcePath, String targetPath, RConnection c) throws Exception
sourcePath
- the server path nametargetPath
- the client path namec
- the connection to R
Exception
- if the file could not be copiedgetBytesFromFileOnServer(String, RConnection)
protected static byte[] getBytesFromFileOnServer(String sourcePath, RConnection c) throws Exception
sourcePath
- the the sourcePath namec
- the connection to R
sourcePath
Exception
- if the content of the source could not be copied in the byte arraypublic static RConnection openRConnection(String rServeHostName, String loginName, String passwd) throws Exception
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 | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |