本文整理汇总了Java中gov.nih.nci.cagrid.common.Utils.clean方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.clean方法的具体用法?Java Utils.clean怎么用?Java Utils.clean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.cagrid.common.Utils
的用法示例。
在下文中一共展示了Utils.clean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGallery
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void createGallery() {
String name = this.getGalleryNane().getText();
if(Utils.clean(name)==null){
ErrorDialog.showError("You must specify a gallery name.");
return;
}
try {
getProgress().showProgress("Creating gallery...");
PhotoSharingHandle handle = this.root.getServiceHandle();
handle.createGallery(name);
this.root.refresh();
getProgress().stopProgress();
dispose();
} catch (Exception e) {
ErrorDialog.showError(Utils.getExceptionMessage(e),e);
}
}
示例2: assertStringIteratorsEqual
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
protected void assertStringIteratorsEqual(Iterator iter1, Iterator iter2) {
assertTrue("Nothing found in first iterator!", iter1.hasNext());
// iterate orig and fail if new doesn't have the same entry
while (iter1.hasNext()) {
String val1 = Utils.clean((String) iter1.next());
if (!iter2.hasNext()) {
fail("The first iterator has more values than the second.");
}
String val2 = Utils.clean((String) iter2.next());
// System.out.println("Comparing [" + val1 + "] to [" + val2 +
// "].");
// make sure the values are the same
assertEquals(val1, val2);
}
// both should be done; if not fail
if (iter2.hasNext()) {
fail("The second iterator has more values than the first.");
}
}
示例3: getAttribute
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private String getAttribute(SAMLAssertion saml, String namespace, String name) throws InvalidAssertionException {
Iterator itr = saml.getStatements();
while (itr.hasNext()) {
Object o = itr.next();
if (o instanceof SAMLAttributeStatement) {
SAMLAttributeStatement att = (SAMLAttributeStatement) o;
Iterator attItr = att.getAttributes();
while (attItr.hasNext()) {
SAMLAttribute a = (SAMLAttribute) attItr.next();
if ((a.getNamespace().equals(namespace)) && (a.getName().equals(name))) {
Iterator vals = a.getValues();
while (vals.hasNext()) {
String val = Utils.clean((String) vals.next());
if (val != null) {
return val;
}
}
}
}
}
}
InvalidAssertionException fault = FaultHelper.createFaultException(InvalidAssertionException.class, "The assertion does not contain the required attribute, " + namespace + ":" + name);
throw fault;
}
示例4: saveGridMapAndGetLocation
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public String saveGridMapAndGetLocation() throws Exception {
String location = this.gridmapLocation.getText();
if ((location == null) || (location.trim().length() == 0)) {
throw new Exception("No Grid Map File Specified!!!");
} else {
File f = new File(location);
PrintWriter out = new PrintWriter(new FileOutputStream(f, false));
int count = ((GridMapTable) this.gridmapTable).getUserCount();
for (int i = 0; i < count; i++) {
GridMap map = ((GridMapTable) this.gridmapTable).getUserAt(i);
StringBuffer line = new StringBuffer();
line.append("\"" + map.getGridIdentity() + "\"");
String users = Utils.clean(map.getLocalUser());
if (users != null) {
line.append(" " + users);
}
out.println(line.toString());
}
out.close();
return location;
}
}
示例5: addPhoto
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void addPhoto() {
String name = getPhotoName().getText();
if (Utils.clean(name) == null) {
ErrorDialog.showError("You must specify name for the photo you wish to add..");
return;
}
String des = getDescription().getText();
if (Utils.clean(des) == null) {
ErrorDialog.showError("You must specify a description for the photo you wish to add..");
return;
}
String file = getPath().getText();
if (Utils.clean(file) == null) {
ErrorDialog.showError("You must specify the file in which the photo you wish to add is contained.");
return;
}
try {
getProgress().showProgress("Uploading the photo " + name + "....");
this.root.getGallery().addPhoto(name, des, new File(file));
getProgress().stopProgress();
dispose();
} catch (Exception e) {
ErrorDialog.showError(Utils.getExceptionMessage(e), e);
getProgress().stopProgress();
}
}
示例6: addUpdatePrivileges
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void addUpdatePrivileges() {
try {
String id = Utils.clean(getIdentity().getText());
if (id == null) {
ErrorDialog.showError("Please enter a valid identity!!!");
}
boolean reload = false;
StringBuffer sb = new StringBuffer();
sb.append("Updating the privileges resulted in the following:\n");
String s1 = addUpdateCreate();
if (s1 != null) {
reload = true;
sb.append(s1 + "\n");
}
String s2 = addUpdateStem();
if (s2 != null) {
reload = true;
sb.append(s2);
}
dispose();
if (reload) {
browser.loadPrivileges();
}
GridApplication.getContext().showMessage(sb.toString());
} catch (Exception e) {
ErrorDialog.showError(e);
FaultUtil.logFault(log, e);
}
}
示例7: AuthenticationProperties
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public AuthenticationProperties(String csmContext) throws Exception {
java.util.Date d = new java.util.Date();
id = d.getTime();
this.csmContext = csmContext;
this.ca = new CA();
org.cagrid.gaards.pki.Credential c = this.ca
.createIdentityCertificate("Mr Assertion Signer");
this.signingCertificate = c.getCertificate();
this.signingKey = c.getPrivateKey();
this.signingKeyPassword = "password";
certificate = new File(id + ".cert");
CertUtil.writeCertificate(signingCertificate, certificate);
key = new File(id + ".key");
KeyUtil.writePrivateKey(signingKey, key, signingKeyPassword);
properties = new File(id + ".properties");
Properties props = new Properties();
props.setProperty("gaards.authentication.saml.cert", certificate
.getAbsolutePath());
props.setProperty("gaards.authentication.saml.key", key
.getAbsolutePath());
props.setProperty("gaards.authentication.saml.key.password",
signingKeyPassword);
if (Utils.clean(this.csmContext) != null) {
props.setProperty("gaards.authentication.csm.app.context",
this.csmContext);
}
props.store(new FileOutputStream(properties), null);
}
示例8: getUserClient
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public DelegationUserClient getUserClient(GlobusCredential credential) throws Exception {
DelegationUserClient client = new DelegationUserClient(getServiceDescriptor().getServiceURL(), credential);
if (Utils.clean(getServiceDescriptor().getServiceIdentity()) != null) {
IdentityAuthorization auth = new IdentityAuthorization(getServiceDescriptor().getServiceIdentity());
client.setAuthorization(auth);
}
return client;
}
示例9: setAssertingCredentialsEncryptionPassword
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void setAssertingCredentialsEncryptionPassword(String assertingCredentialsEncryptionPassword)
throws DorianInternalFault {
if (Utils.clean(assertingCredentialsEncryptionPassword) == null) {
DorianInternalFault f = new DorianInternalFault();
f.setFaultString("Invalid asserting credentials password specified.");
throw f;
}
this.assertingCredentialsEncryptionPassword = assertingCredentialsEncryptionPassword;
}
示例10: registerHandler
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void registerHandler(EventHandler handler) throws InvalidHandlerException {
if (Utils.clean(handler.getName()) == null) {
throw new InvalidHandlerException("Invalid name provided for handler.");
}
if (!handlers.containsKey(handler.getName())) {
handlers.put(handler.getName(), handler);
} else {
throw new InvalidHandlerException("The handler " + handler.getName() + " is already registered.");
}
}
示例11: getLocalAdminClient
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public LocalAdministrationClient getLocalAdminClient(GlobusCredential credential) throws Exception {
LocalAdministrationClient client = new LocalAdministrationClient(getServiceDescriptor().getServiceURL(),
credential);
if (Utils.clean(getServiceDescriptor().getServiceIdentity()) != null) {
IdentityAuthorization auth = new IdentityAuthorization(getServiceDescriptor().getServiceIdentity());
client.setAuthorization(auth);
}
client.setPolicy(policy);
return client;
}
示例12: validateAndGetAuthenticationServiceURL
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private String validateAndGetAuthenticationServiceURL(TrustedIdP idp) throws DorianInternalFault,
InvalidTrustedIdPFault {
if (Utils.clean(idp.getAuthenticationServiceURL()) == null) {
return "";
}
try {
new URL(idp.getAuthenticationServiceURL());
} catch (Exception e) {
InvalidTrustedIdPFault fault = new InvalidTrustedIdPFault();
fault.setFaultString("Invalid Authentication Service URL specified!!!");
throw fault;
}
return idp.getAuthenticationServiceURL();
}
示例13: validateAndGetAuthenticationServiceIdentity
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private String validateAndGetAuthenticationServiceIdentity(TrustedIdP idp) throws DorianInternalFault,
InvalidTrustedIdPFault {
String id = idp.getAuthenticationServiceIdentity();
if (Utils.clean(id) == null) {
return "";
} else {
return id;
}
}
示例14: addValue
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void addValue() {
String value = Utils.clean(valueToAdd.getText());
if (value == null) {
showErrorMessage("Error Adding Value", "No value specified, please specify a value to add!!!");
return;
} else {
Property p = properties.get(getPropertySelector().getSelectedItem());
Values v = p.getValues();
String[] newVals = null;
if (v != null) {
String[] vals = v.getValue();
if (vals != null) {
newVals = new String[vals.length + 1];
for (int i = 0; i < vals.length; i++) {
newVals[i] = vals[i];
}
newVals[vals.length] = value;
v.setValue(newVals);
} else {
newVals = new String[1];
newVals[0] = value;
v.setValue(newVals);
}
} else {
v = new Values();
p.setValues(v);
newVals = new String[1];
newVals[0] = value;
v.setValue(newVals);
}
this.loadValues(p);
}
}
示例15: getUserClient
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public GridUserClient getUserClient() throws Exception {
GridUserClient client = new GridUserClient(getServiceDescriptor().getServiceURL());
if (Utils.clean(getServiceDescriptor().getServiceIdentity()) != null) {
IdentityAuthorization auth = new IdentityAuthorization(getServiceDescriptor().getServiceIdentity());
client.setAuthorization(auth);
}
client.setPolicy(policy);
return client;
}