airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r1482894 - in /airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac: context/security/GSISecurityContext.java handler/GridFTPInputHandler.java
Date Wed, 15 May 2013 15:19:44 GMT
Author: amilaj
Date: Wed May 15 15:19:44 2013
New Revision: 1482894

URL: http://svn.apache.org/r1482894
Log:
Fixing an issue with GSISecurityContext

Modified:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java?rev=1482894&r1=1482893&r2=1482894&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
Wed May 15 15:19:44 2013
@@ -75,18 +75,21 @@ public class GSISecurityContext extends 
 
     public GSSCredential getGssCredentials() throws SecurityException {
 
-        try {
+        GSSCredential credential = null;
 
-            GSSCredential credential = this.myProxyManager.getCredentialsFromStore(gatewayId,
tokenId);
+        try {
 
-            if (credential == null)
-                return getGssCredentialsFromUserPassword();
-            else
-                return credential;
+            credential = this.myProxyManager.getCredentialsFromStore(gatewayId, tokenId);
 
         } catch (Exception e) {
-            throw new SecurityException(e.getMessage(), e);
+            log.warn("An error occurred while retrieving credentials from credential store.
" +
+                    "But continuing with password credentials. ", e);
         }
+
+        if (credential == null)
+            return getGssCredentialsFromUserPassword();
+        else
+            return credential;
     }
 
 

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java?rev=1482894&r1=1482893&r2=1482894&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java
Wed May 15 15:19:44 2013
@@ -130,8 +130,12 @@ public class GridFTPInputHandler impleme
                     try {
                     	fis = new FileInputStream(localFile);
                     	ftp.uploadFile(destURI, gssCred, fis);
-                    }finally {
-                    	fis.close();
+                    } catch (IOException e) {
+                        throw new GFacException("Unable to create file : " + localFile ,e);
+                    } finally {
+                        if (fis != null) {
+                            fis.close();
+                        }
                     }
                 } else if (paramValue.startsWith("http")) {
                 	// no need to do if it is unicore



Mime
View raw message