[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tm-cvs-commit] dmcknight org.eclipse.tm.rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util Sender.java

Update of /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util
In directory dev2:/tmp/cvs-serv667/src/org/eclipse/dstore/internal/core/util

Modified Files:
	Sender.java 
Log Message:
tracing and support for getting class bytes via the file

Index: Sender.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/Sender.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Sender.java	27 Jun 2011 12:16:09 -0000	1.15
--- Sender.java	13 Oct 2011 15:21:51 -0000	1.16
***************
*** 25,28 ****
--- 25,30 ----
  import java.io.BufferedInputStream;
  import java.io.BufferedWriter;
+ import java.io.File;
+ import java.io.FileInputStream;
  import java.io.IOException;
  import java.io.InputStream;
***************
*** 198,204 ****
  		{
  			ClassLoader loader = (ClassLoader) loaders.get(i);
! 			
  			classInStream = loader.getResourceAsStream(className);
  			classLocation = loader.getResource(className);
  			if (classInStream != null && classLocation != null) break;
  		}
--- 200,218 ----
  		{
  			ClassLoader loader = (ClassLoader) loaders.get(i);
! 		
  			classInStream = loader.getResourceAsStream(className);
  			classLocation = loader.getResource(className);
+ 			
+ 			if (classInStream == null && classLocation != null){
+ 				try {
+ 					String file = classLocation.getFile();
+ 					File f = new File(file);
+ 					if (f.exists()){
+ 						classInStream = new FileInputStream(f);
+ 					}
+ 				} catch (Exception e) {
+ 					_dataStore.trace(e);
+ 				}
+ 			}
  			if (classInStream != null && classLocation != null) break;
  		}