|
||||||||||
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 was 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. |
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 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
byte
array.
sourcePath
- the source path namec
- the connection to R
byte
array with the content of
sourcePath
Exception
- if the content of the source could not be copied to the
byte
arraypublic 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 | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |