[jboss-svn-commits] JBL Code SVN: r8743 - labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Jan 7 06:09:56 EST 2007


Author: mark.little at jboss.com
Date: 2007-01-07 06:09:54 -0500 (Sun, 07 Jan 2007)
New Revision: 8743

Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java
Log:
http://jira.jboss.com/jira/browse/JBESB-335

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	2007-01-07 11:08:37 UTC (rev 8742)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	2007-01-07 11:09:54 UTC (rev 8743)
@@ -102,7 +102,7 @@
 		try
 		{
 			_outputSuffix = _epr.getPostSuffix();
-			_logger.debug("output suffix set to "+_outputSuffix,new Exception("DEBUGGING"));
+			_logger.debug("output suffix set to "+_outputSuffix);
 		}
 		catch (URISyntaxException e)
 		{
@@ -270,7 +270,7 @@
 		{
 			FileHandler handler = (null != _localFhandler) ? _localFhandler
 					: FileHandlerFactory.getInstance().getFileHandler(_epr);
-
+		
 			File[] files = handler.getFileList();
 
 			if (null != files && files.length > 0)
@@ -357,6 +357,9 @@
 					.debug("No valid work suffix found in EPR - using default of "
 							+ sfx);
 		}
+		
+		// TODO what if input.getParent() returns null?!
+		
 		return new File(input.getParent(), input.getName() + sfx);
 	} // ________________________________
 
@@ -406,6 +409,12 @@
 		}
 
 		String inputDir = input.getParent();
+		
+		// getParent could return null!!
+		
+		if (inputDir == null)
+			_logger.debug("Could not get parent directory for "+input);
+		
 		String dir = null;
 		try
 		{
@@ -434,6 +443,25 @@
 		}
 		if (Util.isNullString(sfx))
 		{
+			if (dir == null)  // means inputDir is also null!
+			{
+				/*
+				 * Aarrghh! We should be able to return an exception, but
+				 * can't. Not changing the signature at this stage. Post
+				 * GA.
+				 * 
+				 * Plus we shouldn't be assuming getParent never returns null
+				 * in the first place.
+				 */
+				
+				_logger.error("No way to determine post process directory. Will use a default relative to cwd.");
+				
+				// does a default make sense?!
+				
+				//dir = "post";
+				//sfx = ".esbProcessed";
+			}
+			
 			if (dir.equals(inputDir))
 			{
 				sfx = ".esbProcessed";




More information about the jboss-svn-commits mailing list