[DS-707] Remove useless methods

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5664 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Graham Triggs
2010-10-26 21:31:29 +00:00
parent 2d065ced4f
commit cb80f0cad4
26 changed files with 202 additions and 132 deletions

View File

@@ -156,7 +156,8 @@ public class Brand
bWidth = fm.stringWidth(brandText.getText()) + xOffset * 2 + 1;
bHeight = fm.getHeight();
bx = by = 0;
bx = 0;
by = 0;
if (brandText.getLocation().equals(BrandText.TL))
{

View File

@@ -200,9 +200,9 @@ public class LDAPAuthentication
if (ldap.ldapAuthenticate(netid, password, context))
{
context.setCurrentUser(eperson = EPerson.findByNetid(context, netid.toLowerCase()));
log.info(LogManager
.getHeader(context, "authenticate", "type=ldap"));
eperson = EPerson.findByNetid(context, netid.toLowerCase());
context.setCurrentUser(eperson);
log.info(LogManager.getHeader(context, "authenticate", "type=ldap"));
return SUCCESS;
}
else

View File

@@ -81,18 +81,14 @@ public class ShibAuthentication implements AuthenticationMethod
String name;
while (names.hasMoreElements())
{
log.debug("header:" + (name = names.nextElement().toString()) + "="
+ request.getHeader(name));
name = names.nextElement().toString();
log.debug("header:" + name + "=" + request.getHeader(name));
}
boolean isUsingTomcatUser = ConfigurationManager
.getBooleanProperty("authentication.shib.email-use-tomcat-remote-user");
String emailHeader = ConfigurationManager
.getProperty("authentication.shib.email-header");
String fnameHeader = ConfigurationManager
.getProperty("authentication.shib.firstname-header");
String lnameHeader = ConfigurationManager
.getProperty("authentication.shib.lastname-header");
boolean isUsingTomcatUser = ConfigurationManager.getBooleanProperty("authentication.shib.email-use-tomcat-remote-user");
String emailHeader = ConfigurationManager.getProperty("authentication.shib.email-header");
String fnameHeader = ConfigurationManager.getProperty("authentication.shib.firstname-header");
String lnameHeader = ConfigurationManager.getProperty("authentication.shib.lastname-header");
String email = null;
String fname = null;

View File

@@ -120,7 +120,8 @@ public class Bitstream extends DSpaceObject
// Cache ourselves
context.cache(this, row.getIntColumn("bitstream_id"));
modified = modifiedMetadata = false;
modified = false;
modifiedMetadata = false;
clearDetails();
}

View File

@@ -153,7 +153,8 @@ public class Bundle extends DSpaceObject
// Cache ourselves
context.cache(this, row.getIntColumn("bundle_id"));
modified = modifiedMetadata = false;
modified = false;
modifiedMetadata = false;
}
/**

View File

@@ -174,7 +174,8 @@ public class Collection extends DSpaceObject
// Cache ourselves
context.cache(this, row.getIntColumn("collection_id"));
modified = modifiedMetadata = false;
modified = false;
modifiedMetadata = false;
clearDetails();
}

View File

@@ -130,7 +130,8 @@ public class Community extends DSpaceObject
// Cache ourselves
context.cache(this, row.getIntColumn("community_id"));
modified = modifiedMetadata = false;
modified = false;
modifiedMetadata = false;
admins = groupFromColumn("admin");

View File

@@ -262,7 +262,8 @@ public abstract class SHERPARoMEOProtocol implements ChoiceAuthority
else if (localName.equals(labelElement) && textValue != null)
{
// plug in label value
result[rindex].value = result[rindex].label = textValue.trim();
result[rindex].value = textValue.trim();
result[rindex].label = result[rindex].value;
}
else if (authorityElement != null && localName.equals(authorityElement) && textValue != null)
{

View File

@@ -574,7 +574,8 @@ public abstract class AbstractMETSDisseminator
}
else
{
xwalkName = metsName = typeSpec;
metsName = typeSpec;
xwalkName = typeSpec;
}
// First, check to see if the crosswalk we are using is a normal DisseminationCrosswalk

View File

@@ -687,26 +687,31 @@ public class METSManifest
return xmlData.getChildren();
}
}
else if ((mdRef = mdSec.getChild("mdRef", metsNS)) != null)
else
{
String mimeType = mdRef.getAttributeValue("MIMETYPE");
if (mimeType != null && mimeType.equalsIgnoreCase("text/xml"))
mdRef = mdSec.getChild("mdRef", metsNS);
if (mdRef != null)
{
Document mdd = parser.build(callback.getInputStream(mdRef));
List<Element> result = new ArrayList<Element>(1);
result.add(mdd.getRootElement());
return result;
String mimeType = mdRef.getAttributeValue("MIMETYPE");
if (mimeType != null && mimeType.equalsIgnoreCase("text/xml"))
{
Document mdd = parser.build(callback.getInputStream(mdRef));
List<Element> result = new ArrayList<Element>(1);
result.add(mdd.getRootElement());
return result;
}
else
{
log.warn("Ignoring mdRef section because MIMETYPE is not XML, but: "+mimeType);
return new ArrayList<Element>(0);
}
}
else
{
log.warn("Ignoring mdRef section because MIMETYPE is not XML, but: "+mimeType);
return new ArrayList<Element>(0);
throw new MetadataValidationException("Invalid METS Manifest: ?mdSec element with neither mdRef nor mdWrap child.");
}
}
else
{
throw new MetadataValidationException("Invalid METS Manifest: ?mdSec element with neither mdRef nor mdWrap child.");
}
}
catch (JDOMException je)
{
@@ -752,13 +757,17 @@ public class METSManifest
outputPretty.outputString(xmlData.getChildren()).getBytes());
}
}
else if ((mdRef = mdSec.getChild("mdRef", metsNS)) != null)
{
return callback.getInputStream(mdRef);
}
else
{
throw new MetadataValidationException("Invalid METS Manifest: ?mdSec element with neither mdRef nor mdWrap child.");
mdRef = mdSec.getChild("mdRef", metsNS);
if (mdRef != null)
{
return callback.getInputStream(mdRef);
}
else
{
throw new MetadataValidationException("Invalid METS Manifest: ?mdSec element with neither mdRef nor mdWrap child.");
}
}
}

View File

@@ -366,8 +366,8 @@ public class PDFPackager
log.debug("PDF Info dict title=\"" + title + "\"");
}
item.addDC("title", null, "en", title);
String value;
if ((value = docinfo.getAuthor()) != null)
String value = docinfo.getAuthor();
if (value != null)
{
item.addDC("contributor", "author", null, value);
if (log.isDebugEnabled())
@@ -375,32 +375,41 @@ public class PDFPackager
log.debug("PDF Info dict author=\"" + value + "\"");
}
}
if ((value = docinfo.getCreator()) != null)
value = docinfo.getCreator();
if (value != null)
{
item.addDC("description", "provenance", "en",
"Application that created the original document: " + value);
}
if ((value = docinfo.getProducer()) != null)
value = docinfo.getProducer();
if (value != null)
{
item.addDC("description", "provenance", "en",
"Original document converted to PDF by: " + value);
}
if ((value = docinfo.getSubject()) != null)
value = docinfo.getSubject();
if (value != null)
{
item.addDC("description", "abstract", null, value);
}
if ((value = docinfo.getKeywords()) != null)
value = docinfo.getKeywords();
if (value != null)
{
item.addDC("subject", "other", null, value);
}
// Take either CreationDate or ModDate as "date.created",
// Too bad there's no place to put "last modified" in the DC.
Calendar calValue;
if ((calValue = docinfo.getCreationDate()) == null)
Calendar calValue = docinfo.getCreationDate();
if (calValue == null)
{
calValue = docinfo.getModificationDate();
}
if (calValue != null)
{
item.addDC("date", "created", null,

View File

@@ -108,7 +108,8 @@ public class EPerson extends DSpaceObject
// Cache ourselves
context.cache(this, row.getIntColumn("eperson_id"));
modified = modifiedMetadata = false;
modified = false;
modifiedMetadata = false;
clearDetails();
}

View File

@@ -134,7 +134,8 @@ public class ConsumerProfile
else
{
int filter[] = new int[2];
filter[0] = filter[1] = 0;
filter[0] = 0;
filter[1] = 0;
String objectNames[] = fpart[0].split("\\|");
for (int k = 0; k < objectNames.length; ++k)
{

View File

@@ -101,7 +101,8 @@ public class OrderFormat
if (type != null && type.length() > 0)
{
// Use a delegate if one is configured
if ((delegate = OrderFormat.getDelegate(type)) != null)
delegate = OrderFormat.getDelegate(type);
if (delegate != null)
{
return delegate.makeSortString(value, language);
}