Name |
Type |
Description |
find_java_home |
beanshell |
ScriptjavaHome = System.getProperty("java.home");
security = new File(new File(javaHome, "lib"), "security").getAbsolutePath(); |
check_security_policy |
beanshell |
ScriptpolicyJar = new File(security, "local_policy.jar");
policyJarURL = policyJar.toURL().toString();
urls = new URL[]{policyJar.toURL()} ;
cl = new java.net.URLClassLoader(urls);
default_local = cl.getResource("default_local.policy").toExternalForm();
|
Get_Web_Page_from_URL |
localworker |
Scriptif ((url == void) || (url == null)) {
throw new RuntimeException("The url must be specified");
}
URL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
StringBuffer result = new StringBuffer();
BufferedReader reader;
String encoding = con.getContentEncoding();
if (encoding == null) {
reader = new BufferedReader(new InputStreamReader(in));
} else {
reader = new BufferedReader(new InputStreamReader(in, encoding));
}
String line = null;
String NEWLINE = System.getProperty("line.separator");
while ((line = reader.readLine()) != null) {
result.append(line);
result.append(NEWLINE);
}
reader.close();
contents = result.toString();
|
Filter_list_of_strings_extracting_match_to_a_regex |
localworker |
Scriptimport java.util.regex.*;
filteredlist = new ArrayList();
Pattern thePat = Pattern.compile(regex);
int theGroup = Integer.parseInt(group);
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
Matcher matcher = thePat.matcher(item);
if (matcher.find()) {
filteredlist.add(matcher.group(theGroup));
}
}
|
permission |
stringconstant |
Value\spermission\s*(\S*) |
sha1 |
beanshell |
Scriptimport java.security.DigestInputStream;
import java.security.MessageDigest;
import java.io.ByteArrayInputStream;
import java.util.Formatter;
// adapted from http://www.javablogging.com/sha1-and-md5-checksums-in-java/
MessageDigest algorithm = MessageDigest.getInstance("SHA1");
byteStream = new java.io.ByteArrayInputStream(string.getBytes("utf-8"));
digest = new DigestInputStream(byteStream, algorithm);
while (digest.read() != -1);
byte[] hash = algorithm.digest();
Formatter formatter = new Formatter();
for (byte b : hash) {
formatter.format("%02x", new Object[]{b});
}
sha1 = formatter.toString();
|
first_group |
stringconstant |
Value1 |
Split_string_into_string_list_by_regular_expression |
localworker |
ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = ",";
if (regex != void) {
regexString = regex;
}
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
split.add(result[i]);
}
}
|
newline |
stringconstant |
Value\n |
expected_sha1 |
stringconstant |
Valuec3c2631b755348a86ac6b6b7d7cc8ab0a6a453f1 |
String_List_Intersection |
localworker |
ScriptList intersection = new ArrayList();
for (Iterator i = list1.iterator(); i.hasNext();) {
Object o = i.next();
if (list2.contains(o)) {
intersection.add(o);
}
}
|
Tell_ok |
localworker |
Scriptimport javax.swing.JOptionPane;
JOptionPane.showMessageDialog(null, (message == void ? null : message), (title == void ? null : title), JOptionPane.INFORMATION_MESSAGE);
answer = "answer";
|
JCE_ok |
stringconstant |
ValueYou have JCE Unlimited Strength Cryptography correctly installed.
Taverna's credential manager and security support should work.
If you are still having problems, try to delete the "security" folder
from your Taverna home directory, by in the menu going to
Advanced -> Show data and logs folder. |
String_List_Difference |
localworker |
ScriptList difference = new ArrayList();
for (Iterator i = list1.iterator(); i.hasNext();) {
Object o = i.next();
if (!list2.contains(o)) {
difference.add(o);
}
}
for (Iterator i = list2.iterator(); i.hasNext();) {
Object o = i.next();
if (!list1.contains(o)) {
difference.add(o);
}
}
|
Remove_String_Duplicates |
localworker |
ScriptList strippedlist = new ArrayList();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
if (strippedlist.contains(item) == false) {
strippedlist.add(item);
}
}
|
Tell_missing |
localworker |
Scriptimport javax.swing.JOptionPane;
JOptionPane.showMessageDialog(null, (message == void ? null : message), (title == void ? null : title), JOptionPane.INFORMATION_MESSAGE);
answer = "answer";
|
JCE_missing |
stringconstant |
ValueYou do NOT have JCE Unlimited Strength Cryptography correctly installed.
Taverna's credential manager and security support will NOT work properly.
You need to download and install the JCE Unlimited Strength Cryptography policy,
unzip it, then install it to the lib/security folder of your Java JRE installation. |
open_location |
workflow |
|
find_jce_url |
beanshell |
Scriptjava7 = "http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html";
java6 = "http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html";
fallback = "http://www.mygrid.org.uk/dev/wiki/display/taverna23/Supported+standards#Supportedstandards-JavaCryptographyPolicy";
version = System.getProperty("java.version");
if (version.startsWith("1.6")) {
url = java6;
} else if (version.startsWith("1.7")) {
url = java7;
} else {
url = fallback;
}
|
Comments (0)
No comments yet
Log in to make a comment