- From: Jean-Guilhem Rouel via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 11 Aug 2009 13:43:04 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/org/w3c/unicorn/input In directory hutz:/tmp/cvs-serv6157/org/w3c/unicorn/input Modified Files: FakeUploadInputModule.java InputModule.java FileItemInputModule.java InputFactory.java URIInputModule.java UploadInputModule.java DirectInputModule.java Log Message: Code cleanup Index: FakeUploadInputModule.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/input/FakeUploadInputModule.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FakeUploadInputModule.java 25 Sep 2008 17:37:43 -0000 1.4 +++ FakeUploadInputModule.java 11 Aug 2009 13:43:01 -0000 1.5 @@ -14,10 +14,10 @@ import org.w3c.unicorn.contract.EnumInputMethod; /** - * Class used for the fake upload input method check It - * means make the observer believe it was a direct input whereas it - * wasn't - * @author Damien LEROY + * Class used for the fake upload input method check It means make the observer + * believe it was a direct input whereas it wasn't + * + * @author Damien LEROY */ public class FakeUploadInputModule implements UploadInputModule { @@ -49,10 +49,9 @@ */ protected FakeUploadInputModule(final InputModule aInputModule) throws IOException { - FakeUploadInputModule.logger.trace("Constructor"); - if (FakeUploadInputModule.logger.isDebugEnabled()) { - FakeUploadInputModule.logger.debug("Input module : " + aInputModule - + "."); + InputModule.logger.trace("Constructor"); + if (InputModule.logger.isDebugEnabled()) { + InputModule.logger.debug("Input module : " + aInputModule + "."); } this.aMimeType = aInputModule.getMimeType(); this.sContent = aInputModule.getStringContent(); @@ -62,7 +61,7 @@ * Get the filename of the input */ public String getFileName() { - FakeUploadInputModule.logger.trace("getFileName"); + InputModule.logger.trace("getFileName"); return this.sFileName; } @@ -70,7 +69,7 @@ * Get the stream of the input using the content */ public InputStream getInputStream() throws IOException { - FakeUploadInputModule.logger.trace("getInputStream"); + InputModule.logger.trace("getInputStream"); final PipedOutputStream aPipedOutputStream = new PipedOutputStream(); aPipedOutputStream.write(this.sContent.getBytes()); aPipedOutputStream.close(); @@ -80,22 +79,22 @@ } public EnumInputMethod getEnumInputMethod() { - FakeUploadInputModule.logger.trace("getEnumInputMethod"); + InputModule.logger.trace("getEnumInputMethod"); return this.aEnumInputMethod; } public MimeType getMimeType() { - FakeUploadInputModule.logger.trace("getMimeType"); + InputModule.logger.trace("getMimeType"); return this.aMimeType; } public Object getParameterValue() { - FakeUploadInputModule.logger.trace("getParameterValue"); + InputModule.logger.trace("getParameterValue"); return this.sContent; } public String getStringContent() throws IOException { - FakeUploadInputModule.logger.trace("getStringContent"); + InputModule.logger.trace("getStringContent"); return this.sContent; } @@ -103,16 +102,18 @@ * Dispose the object */ public void dispose() { - FakeUploadInputModule.logger.trace("dispose"); + InputModule.logger.trace("dispose"); } /** * prints the object */ + @Override public String toString() { final int iStringBufferSize = 500; final StringBuffer aStringBuffer = new StringBuffer(iStringBufferSize); - aStringBuffer.append("FakeUploadInputModule{mimetype: ").append(this.aMimeType); + aStringBuffer.append("FakeUploadInputModule{mimetype: ").append( + this.aMimeType); aStringBuffer.append(", filename: ").append(this.sFileName).append("}"); return aStringBuffer.toString(); Index: DirectInputModule.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/input/DirectInputModule.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- DirectInputModule.java 25 Sep 2008 17:37:43 -0000 1.4 +++ DirectInputModule.java 11 Aug 2009 13:43:02 -0000 1.5 @@ -12,7 +12,8 @@ /** * Class used for the direct input method check - * @author Damien LEROY + * + * @author Damien LEROY */ public class DirectInputModule implements InputModule { @@ -41,10 +42,10 @@ */ protected DirectInputModule(final MimeType aMimeType, final Object oInputParameterValue) { - DirectInputModule.logger.trace("Constructor"); - if (DirectInputModule.logger.isDebugEnabled()) { - DirectInputModule.logger.debug("Mime type : " + aMimeType + "."); - DirectInputModule.logger.debug("Input parameter value : " + InputModule.logger.trace("Constructor"); + if (InputModule.logger.isDebugEnabled()) { + InputModule.logger.debug("Mime type : " + aMimeType + "."); + InputModule.logger.debug("Input parameter value : " + oInputParameterValue + "."); } if (!(oInputParameterValue instanceof String)) { @@ -65,32 +66,31 @@ */ protected DirectInputModule(final InputModule aInputModule) throws IOException { - DirectInputModule.logger.trace("Constructor"); - if (DirectInputModule.logger.isDebugEnabled()) { - DirectInputModule.logger.debug("Input module : " + aInputModule - + "."); + InputModule.logger.trace("Constructor"); + if (InputModule.logger.isDebugEnabled()) { + InputModule.logger.debug("Input module : " + aInputModule + "."); } this.sInput = aInputModule.getStringContent(); this.aMimeType = aInputModule.getMimeType(); } public EnumInputMethod getEnumInputMethod() { - DirectInputModule.logger.trace("getEnumInputMethod"); + InputModule.logger.trace("getEnumInputMethod"); return this.aEnumInputMethod; } public MimeType getMimeType() { - DirectInputModule.logger.trace("getMimeType"); + InputModule.logger.trace("getMimeType"); return this.aMimeType; } public Object getParameterValue() { - DirectInputModule.logger.trace("getParameterValue"); + InputModule.logger.trace("getParameterValue"); return this.sInput; } public String getStringContent() { - DirectInputModule.logger.trace("getStringContent"); + InputModule.logger.trace("getStringContent"); return this.sInput; } @@ -98,16 +98,18 @@ * Dispose the object */ public void dispose() { - DirectInputModule.logger.trace("dispose"); + InputModule.logger.trace("dispose"); } /** * Prints the object */ + @Override public String toString() { final int iStringBufferSize = 500; final StringBuffer aStringBuffer = new StringBuffer(iStringBufferSize); - aStringBuffer.append("DirectInputModule{mimetype: ").append(this.aMimeType).append("}"); + aStringBuffer.append("DirectInputModule{mimetype: ").append( + this.aMimeType).append("}"); return aStringBuffer.toString(); } Index: URIInputModule.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/input/URIInputModule.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- URIInputModule.java 25 Sep 2008 17:37:44 -0000 1.5 +++ URIInputModule.java 11 Aug 2009 13:43:01 -0000 1.6 @@ -19,7 +19,8 @@ /** * Class used to deal with the URI method for inputs - * @author Damien LEROY + * + * @author Damien LEROY */ public class URIInputModule implements InputModule { @@ -53,9 +54,9 @@ */ protected URIInputModule(final MimeType aMimeType, final Object oInputParameterValue) { - URIInputModule.logger.trace("Constructor."); - if (URIInputModule.logger.isDebugEnabled()) { - URIInputModule.logger.debug("oInputParameterValue : " + InputModule.logger.trace("Constructor."); + if (InputModule.logger.isDebugEnabled()) { + InputModule.logger.debug("oInputParameterValue : " + oInputParameterValue + "."); } if (!(oInputParameterValue instanceof String)) { @@ -76,9 +77,9 @@ * odd error occurs */ protected URIInputModule(final InputModule aInputModule) throws IOException { - URIInputModule.logger.trace("Constructor."); - if (URIInputModule.logger.isDebugEnabled()) { - URIInputModule.logger.debug("InputModule : " + aInputModule + "."); + InputModule.logger.trace("Constructor."); + if (InputModule.logger.isDebugEnabled()) { + InputModule.logger.debug("InputModule : " + aInputModule + "."); } this.aMimeType = aInputModule.getMimeType(); final Date aDate = new Date(); @@ -98,32 +99,32 @@ } public EnumInputMethod getEnumInputMethod() { - URIInputModule.logger.trace("getEnumInputMethod"); + InputModule.logger.trace("getEnumInputMethod"); return this.aEnumInputMethod; } public MimeType getMimeType() { - URIInputModule.logger.trace("getMimeType"); + InputModule.logger.trace("getMimeType"); return this.aMimeType; } public Object getParameterValue() { - URIInputModule.logger.trace("getParameterValue"); + InputModule.logger.trace("getParameterValue"); return this.sURI; } public String getStringContent() throws IOException { - URIInputModule.logger.trace("getString."); + InputModule.logger.trace("getString."); final URL aURL = new URL(this.sURI); final String sResult = (String) aURL.openConnection().getContent(); - if (URIInputModule.logger.isDebugEnabled()) { - URIInputModule.logger.debug("sResult : " + sResult + "."); + if (InputModule.logger.isDebugEnabled()) { + InputModule.logger.debug("sResult : " + sResult + "."); } return sResult; } public String getURI() { - URIInputModule.logger.trace("getURI"); + InputModule.logger.trace("getURI"); return this.sURI; } @@ -131,9 +132,9 @@ * Dispose the object */ public void dispose() { - URIInputModule.logger.trace("dispose"); + InputModule.logger.trace("dispose"); if (null != this.aFile && this.aFile.delete()) { - URIInputModule.logger.info("File deleted."); + InputModule.logger.info("File deleted."); this.aFile = null; } } @@ -141,14 +142,15 @@ /** * Prints the object */ + @Override public String toString() { final int iStringBufferSize = 500; final StringBuffer aStringBuffer = new StringBuffer(iStringBufferSize); aStringBuffer.append("URIInputModule{"); aStringBuffer.append("mimetype: ").append(this.aMimeType); aStringBuffer.append(", uri: ").append(this.sURI); - aStringBuffer.append("}").append(this.sURI); - + aStringBuffer.append("}").append(this.sURI); + return aStringBuffer.toString(); } Index: InputFactory.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/input/InputFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- InputFactory.java 25 Sep 2008 17:37:44 -0000 1.4 +++ InputFactory.java 11 Aug 2009 13:43:01 -0000 1.5 @@ -15,7 +15,8 @@ /** * Class which deals with the creation of input method - * @author Damien LEROY + * + * @author Damien LEROY */ public class InputFactory { @@ -169,6 +170,7 @@ /** * Prints the object */ + @Override public String toString() { final int iStringBufferSize = 500; final StringBuffer aStringBuffer = new StringBuffer(iStringBufferSize); @@ -177,7 +179,7 @@ for (final InputModule aInputModule : this.mapOfInputModule.values()) { aStringBuffer.append(aInputModule).append(", "); } - aStringBuffer.append("}"); + aStringBuffer.append("}"); return aStringBuffer.toString(); } Index: FileItemInputModule.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/input/FileItemInputModule.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FileItemInputModule.java 25 Sep 2008 17:37:44 -0000 1.4 +++ FileItemInputModule.java 11 Aug 2009 13:43:01 -0000 1.5 @@ -14,6 +14,7 @@ /** * Class to deal with the file input method + * * @author Damien LEROY * */ @@ -44,10 +45,10 @@ */ protected FileItemInputModule(final MimeType aMimeType, final Object oInputParameterValue) { - FileItemInputModule.logger.trace("Constructor"); - if (FileItemInputModule.logger.isDebugEnabled()) { - FileItemInputModule.logger.debug("Mime type : " + aMimeType + "."); - FileItemInputModule.logger.debug("Input parameter value : " + InputModule.logger.trace("Constructor"); + if (InputModule.logger.isDebugEnabled()) { + InputModule.logger.debug("Mime type : " + aMimeType + "."); + InputModule.logger.debug("Input parameter value : " + oInputParameterValue + "."); } if (!(oInputParameterValue instanceof FileItem)) { @@ -59,32 +60,32 @@ } public EnumInputMethod getEnumInputMethod() { - FileItemInputModule.logger.trace("getEnumInputMethod"); + InputModule.logger.trace("getEnumInputMethod"); return this.aEnumInputMethod; } public String getFileName() { - FileItemInputModule.logger.trace("getFileName"); + InputModule.logger.trace("getFileName"); return this.aFileItem.getName(); } public InputStream getInputStream() throws IOException { - FileItemInputModule.logger.trace("getInputStream"); + InputModule.logger.trace("getInputStream"); return this.aFileItem.getInputStream(); } public MimeType getMimeType() { - FileItemInputModule.logger.trace("getMimeType"); + InputModule.logger.trace("getMimeType"); return this.aMimeType; } public Object getParameterValue() { - FileItemInputModule.logger.trace("getParameterValue"); + InputModule.logger.trace("getParameterValue"); return this.aFileItem; } public String getStringContent() { - FileItemInputModule.logger.trace("getStringContent"); + InputModule.logger.trace("getStringContent"); return this.aFileItem.getString(); } @@ -92,7 +93,7 @@ * Dispose the object */ public void dispose() { - FileItemInputModule.logger.trace("dispose"); + InputModule.logger.trace("dispose"); if (null != this.aFileItem) { this.aFileItem.delete(); this.aFileItem = null; @@ -102,11 +103,14 @@ /** * Prints the object */ + @Override public String toString() { final int iStringBufferSize = 500; final StringBuffer aStringBuffer = new StringBuffer(iStringBufferSize); - aStringBuffer.append("FileItemInputModule{mimetype: ").append(this.aMimeType); - aStringBuffer.append(", filename: ").append(this.aFileItem.getName()).append("}"); + aStringBuffer.append("FileItemInputModule{mimetype: ").append( + this.aMimeType); + aStringBuffer.append(", filename: ").append(this.aFileItem.getName()) + .append("}"); return aStringBuffer.toString(); } Index: InputModule.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/input/InputModule.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- InputModule.java 17 Jun 2008 14:09:50 -0000 1.3 +++ InputModule.java 11 Aug 2009 13:43:01 -0000 1.4 @@ -14,7 +14,8 @@ /** * Interface for an input module - * @author Damien LEROY + * + * @author Damien LEROY */ public interface InputModule { Index: UploadInputModule.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/input/UploadInputModule.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- UploadInputModule.java 17 Jun 2008 14:09:50 -0000 1.3 +++ UploadInputModule.java 11 Aug 2009 13:43:01 -0000 1.4 @@ -11,7 +11,8 @@ /** * Interface for the UploadInputModule - * @author Damien LEROY + * + * @author Damien LEROY */ public interface UploadInputModule extends InputModule {
Received on Tuesday, 11 August 2009 13:43:14 UTC