Changeset 4554 for trunk/client
- Timestamp:
- Apr 28, 2014, 1:54:37 PM (9 years ago)
- Location:
- trunk/client/servlet
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/conf/connection.properties.in
r4551 r4554 66 66 alternate.location.target.2 = 67 67 68 # 69 # Settings for SRM client. Used to publish files on Swestore 70 # Path to script for creating proxy: 71 # create proxy = /usr/share/tomcat6/create_proxy.sh 72 create.proxy = /usr/share/tomcat/create_proxy.sh 73 # 74 # srm-set-permissions command. 75 # command in path: 76 srm.set.permissions = srm-set-permissions 77 # alternative: 78 # srm.set.permissions = /opt/d-cache/srm/bin/srm-set-permissions 79 80 81 82 -
trunk/client/servlet/src/org/proteios/action/file/PublishFiles.java
r4474 r4554 1 1 /* 2 Copyright (C) 2012 Fredrik Levander2 Copyright (C) 2012-2014 Fredrik Levander 3 3 4 4 This file is part of Proteios. … … 22 22 package org.proteios.action.file; 23 23 24 import org.proteios.ConnectionPropertiesFile; 24 25 import org.proteios.Context; 25 26 import org.proteios.ContextEnabled; … … 45 46 46 47 /** 47 * This action will change the access rights of the underlying files, which are currently assumed to be on the Swestore storage 48 * This action will change the access rights of the underlying files, which are 49 * currently assumed to be on the Swestore storage 48 50 * 49 51 * @author fredrik … … 55 57 String initsh = "/usr/share/tomcat6/create_proxy.sh"; 56 58 String SRMcommand = "/opt/d-cache/srm/bin/srm-set-permissions"; 57 static String httpsstart = "https://srm.swegrid.se";58 static String srmstart = "srm://srm.swegrid.se";59 59 60 60 … … 77 77 return; 78 78 } 79 ConnectionPropertiesFile pf = new ConnectionPropertiesFile(); 80 if (pf.getProperty("srm.set.permissions") != null) 81 SRMcommand = pf.getProperty("srm.set.permissions"); 82 if (pf.getProperty("create.proxy") != null) 83 initsh = pf.getProperty("create.proxy"); 79 84 java.io.File test = new java.io.File(initsh); 80 85 if (!test.canRead()) … … 88 93 if (!test.canRead()) 89 94 { 90 throw new ActionException("Cannot execute script for proxy generation. create_proxy.sh not found or not readable"); 95 throw new ActionException( 96 "Cannot execute script for proxy generation. create_proxy.sh not found or not readable"); 91 97 } 92 98 } … … 106 112 while ((line = reader.readLine()) != null) 107 113 { 108 log.warn("Proxy generation output:" +line);114 log.warn("Proxy generation output:" + line); 109 115 if (line.contains("No such file") || line.contains("Error")) 110 116 { 111 throw new ActionException("Error in proxy generation:"+line); 117 throw new ActionException( 118 "Error in proxy generation:" + line); 112 119 } 113 120 } … … 142 149 pb1.command(commandarray); 143 150 Process proc = pb1.start(); 144 reader = new BufferedReader(new InputStreamReader( proc145 .getInputStream()));151 reader = new BufferedReader(new InputStreamReader( 152 proc.getInputStream())); 146 153 while ((line = reader.readLine()) != null) 147 154 { 148 log.error("SRM client output"+line); 155 log.error("SRM client output:" + line); 156 if (line.contains("No such file") || line.contains("Error")) 157 { 158 throw new ActionException( 159 "Error issuing srm-set-permissions:" + line); 160 } 149 161 } 150 162 proc.waitFor(); … … 240 252 { 241 253 String retval = uri.replace("http://", "https://"); 242 return retval.replace( httpsstart, srmstart);254 return retval.replace("https://srm.swegrid.se", "srm://srm.swegrid.se"); 243 255 } 244 256
Note: See TracChangeset
for help on using the changeset viewer.