You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/10/10 19:40:00 UTC
svn commit: r1843497 - in
/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight:
PreflightContext.java parser/XmlResultParser.java
Author: tilman
Date: Wed Oct 10 19:40:00 2018
New Revision: 1843497
URL: http://svn.apache.org/viewvc?rev=1843497&view=rev
Log:
PDFBOX-4071: change variable names to make it easier to find them
Modified:
pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java
pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java
Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java?rev=1843497&r1=1843496&r2=1843497&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java (original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java Wed Oct 10 19:40:00 2018
@@ -51,7 +51,7 @@ public class PreflightContext implements
/**
* The datasource to load the document from. Needed by StreamValidationProcess.
*/
- private DataSource source = null;
+ private DataSource dataSource = null;
/**
* Contains all Xref/trailer objects and resolves them into single object using startxref reference.
@@ -84,16 +84,16 @@ public class PreflightContext implements
/**
* Create the DocumentHandler using the DataSource which represent the PDF file to check.
*
- * @param source
+ * @param dataSource
*/
- public PreflightContext(DataSource source)
+ public PreflightContext(DataSource dataSource)
{
- this.source = source;
+ this.dataSource = dataSource;
}
- public PreflightContext(DataSource source, PreflightConfiguration configuration)
+ public PreflightContext(DataSource dataSource, PreflightConfiguration configuration)
{
- this.source = source;
+ this.dataSource = dataSource;
this.config = configuration;
}
@@ -148,12 +148,12 @@ public class PreflightContext implements
*/
public DataSource getSource()
{
- return source;
+ return dataSource;
}
public boolean isComplete()
{
- return (document != null) && (source != null);
+ return (document != null) && (dataSource != null);
}
/**
Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java?rev=1843497&r1=1843496&r2=1843497&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java (original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java Wed Oct 10 19:40:00 2018
@@ -43,12 +43,12 @@ public class XmlResultParser
{
- public Element validate(DataSource source) throws IOException
+ public Element validate(DataSource dataSource) throws IOException
{
try
{
Document rdocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- return validate(rdocument,source);
+ return validate(rdocument,dataSource);
}
catch (ParserConfigurationException e)
{
@@ -57,14 +57,14 @@ public class XmlResultParser
}
- public Element validate(Document rdocument, DataSource source) throws IOException
+ public Element validate(Document rdocument, DataSource dataSource) throws IOException
{
String pdfType = null;
ValidationResult result;
long before = System.currentTimeMillis();
try
{
- PreflightParser parser = new PreflightParser(source);
+ PreflightParser parser = new PreflightParser(dataSource);
try
{
parser.parse();
@@ -82,13 +82,13 @@ public class XmlResultParser
catch(Exception e)
{
long after = System.currentTimeMillis();
- return generateFailureResponse(rdocument, source.getName(), after-before, pdfType, e);
+ return generateFailureResponse(rdocument, dataSource.getName(), after-before, pdfType, e);
}
long after = System.currentTimeMillis();
if (result.isValid())
{
- Element preflight = generateResponseSkeleton(rdocument, source.getName(), after-before);
+ Element preflight = generateResponseSkeleton(rdocument, dataSource.getName(), after-before);
// valid ?
Element valid = rdocument.createElement("isValid");
valid.setAttribute("type", pdfType);
@@ -98,7 +98,7 @@ public class XmlResultParser
}
else
{
- Element preflight = generateResponseSkeleton(rdocument, source.getName(), after-before);
+ Element preflight = generateResponseSkeleton(rdocument, dataSource.getName(), after-before);
// valid ?
createResponseWithError(rdocument, pdfType, result, preflight);
return preflight;