[Join-cvs] join1/src/main/org/figure8/join/services/scripting/ant/tasks RemoteServiceTask.java, 1.
Brought to you by:
lbroudoux
|
From: Laurent B. <lbr...@us...> - 2007-04-08 19:31:47
|
Update of /cvsroot/join/join1/src/main/org/figure8/join/services/scripting/ant/tasks In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9317/services/scripting/ant/tasks Modified Files: RemoteServiceTask.java SubstituteParametersTask.java Log Message: Update deprecated usages Index: RemoteServiceTask.java =================================================================== RCS file: /cvsroot/join/join1/src/main/org/figure8/join/services/scripting/ant/tasks/RemoteServiceTask.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RemoteServiceTask.java 7 Jul 2006 22:10:15 -0000 1.1 --- RemoteServiceTask.java 8 Apr 2007 19:31:44 -0000 1.2 *************** *** 100,109 **** protected AuthenticatedService retrieveRemoteService(String name, Class serviceClass) throws BuildException{ // Retrieve url from project properties, from system property or from task attributes. ! String connectionUrl = project.getUserProperty(JoinTask.URL_PROPERTY); if (connectionUrl == null) connectionUrl = System.getProperty(JoinTask.URL_PROPERTY); if (connectionUrl == null) connectionUrl = url; // Check we really have an url. if (connectionUrl == null || connectionUrl.length() == 0) ! throw new BuildException("No url found for connecting to remote " + name + " service", location); // Retrieve the authenticated service. --- 100,109 ---- protected AuthenticatedService retrieveRemoteService(String name, Class serviceClass) throws BuildException{ // Retrieve url from project properties, from system property or from task attributes. ! String connectionUrl = getProject().getUserProperty(JoinTask.URL_PROPERTY); if (connectionUrl == null) connectionUrl = System.getProperty(JoinTask.URL_PROPERTY); if (connectionUrl == null) connectionUrl = url; // Check we really have an url. if (connectionUrl == null || connectionUrl.length() == 0) ! throw new BuildException("No url found for connecting to remote " + name + " service", getLocation()); // Retrieve the authenticated service. *************** *** 120,124 **** log("Exception while connecting to remote service using " + connectionUrl, Project.MSG_ERR); log("Exception detailed message is: " + e.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while connecting to remote service", e, location); } return service; --- 120,124 ---- log("Exception while connecting to remote service using " + connectionUrl, Project.MSG_ERR); log("Exception detailed message is: " + e.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while connecting to remote service", e, getLocation()); } return service; *************** *** 140,144 **** protected String loginToRemoteService(AuthenticatedService service) throws InvalidLoginException, RemoteException{ // First check if there's a secutiry token. ! String token = project.getUserProperty(JoinTask.SECURITY_TOKEN); if (token == null){ --- 140,144 ---- protected String loginToRemoteService(AuthenticatedService service) throws InvalidLoginException, RemoteException{ // First check if there's a secutiry token. ! String token = getProject().getUserProperty(JoinTask.SECURITY_TOKEN); if (token == null){ *************** *** 153,157 **** // Check we really have user/password pair. if (connectionUser == null || connectionPwd == null) ! throw new BuildException("No user or password for login to the remote AuthenticatedService", location); // Login onto remote service. --- 153,157 ---- // Check we really have user/password pair. if (connectionUser == null || connectionPwd == null) ! throw new BuildException("No user or password for login to the remote AuthenticatedService", getLocation()); // Login onto remote service. *************** *** 172,176 **** protected void releaseRemoteService(AuthenticatedService service, String token){ // First check if there's a secutiry token in context. ! String ctxToken = project.getUserProperty(JoinTask.SECURITY_TOKEN); if (ctxToken == null || !ctxToken.equals(token)){ --- 172,176 ---- protected void releaseRemoteService(AuthenticatedService service, String token){ // First check if there's a secutiry token in context. ! String ctxToken = getProject().getUserProperty(JoinTask.SECURITY_TOKEN); if (ctxToken == null || !ctxToken.equals(token)){ Index: SubstituteParametersTask.java =================================================================== RCS file: /cvsroot/join/join1/src/main/org/figure8/join/services/scripting/ant/tasks/SubstituteParametersTask.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubstituteParametersTask.java 7 Jul 2006 22:10:15 -0000 1.1 --- SubstituteParametersTask.java 8 Apr 2007 19:31:44 -0000 1.2 *************** *** 191,208 **** // Check that environmentKey is present. if (environmentKey == null || environmentKey.length() == 0) ! throw new BuildException("No environment key specified for substituteParameters", location); // Check that targetName is present. if (targetName == null || targetName.length() == 0) ! throw new BuildException("No deployment target specified for substituteParameters", location); // Check that destination dir is present. if (toDir == null || toDir.length() == 0) ! throw new BuildException("No destination directory specified for substituteParameters", location); // Check that destination dir is existing. destinationDir = new File(toDir); if (!destinationDir.isDirectory()) ! throw new BuildException("The destination directory specified is not a valid directory", location); // Check that there's at least one fileset. if (fileSets.isEmpty()) ! throw new BuildException("No FileSet specified for substituteParameters", location); } --- 191,208 ---- // Check that environmentKey is present. if (environmentKey == null || environmentKey.length() == 0) ! throw new BuildException("No environment key specified for substituteParameters", getLocation()); // Check that targetName is present. if (targetName == null || targetName.length() == 0) ! throw new BuildException("No deployment target specified for substituteParameters", getLocation()); // Check that destination dir is present. if (toDir == null || toDir.length() == 0) ! throw new BuildException("No destination directory specified for substituteParameters", getLocation()); // Check that destination dir is existing. destinationDir = new File(toDir); if (!destinationDir.isDirectory()) ! throw new BuildException("The destination directory specified is not a valid directory", getLocation()); // Check that there's at least one fileset. if (fileSets.isEmpty()) ! throw new BuildException("No FileSet specified for substituteParameters", getLocation()); } *************** *** 228,242 **** // Log diagnostic messages and wrap into a BuildException. log("InvalidLoginException while logging to remote service: " + ile.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while logging to remote service", ile, location); } catch (InvalidSessionException ise){ // Log diagnostic messages and wrap into a BuildException. log("InvalidSessionException while invoking remote service: " + ise.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while invoking remote service", ise, location); } catch (RemoteException re){ // Log diagnostic messages and wrap into a BuildException. log("RemoteException while logging to remote service: " + re.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while logging to remote service", re, location); } // Release service and return. --- 228,242 ---- // Log diagnostic messages and wrap into a BuildException. log("InvalidLoginException while logging to remote service: " + ile.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while logging to remote service", ile, getLocation()); } catch (InvalidSessionException ise){ // Log diagnostic messages and wrap into a BuildException. log("InvalidSessionException while invoking remote service: " + ise.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while invoking remote service", ise, getLocation()); } catch (RemoteException re){ // Log diagnostic messages and wrap into a BuildException. log("RemoteException while logging to remote service: " + re.getMessage(), Project.MSG_ERR); ! throw new BuildException("Exception while logging to remote service", re, getLocation()); } // Release service and return. *************** *** 258,264 **** for (int i=0; i<fileSets.size(); i++){ FileSet set = (FileSet)fileSets.get(i); ! DirectoryScanner scanner = set.getDirectoryScanner(project); ! File sourceDir = set.getDir(project); String[] fileNames = scanner.getIncludedFiles(); --- 258,264 ---- for (int i=0; i<fileSets.size(); i++){ FileSet set = (FileSet)fileSets.get(i); ! DirectoryScanner scanner = set.getDirectoryScanner(getProject()); ! File sourceDir = set.getDir(getProject()); String[] fileNames = scanner.getIncludedFiles(); *************** *** 293,297 **** finally{ try {writer.close();} ! catch (Exception e) {} } --- 293,297 ---- finally{ try {writer.close();} ! catch (Exception e) {log("Exception while closing writer", Project.MSG_DEBUG);} } *************** *** 354,360 **** finally{ try {writer.close();} ! catch (Exception e) {} try {reader.close();} ! catch (Exception e) {} } // Return messages. --- 354,360 ---- finally{ try {writer.close();} ! catch (Exception e) {log("Exception while closing writer", Project.MSG_DEBUG);} try {reader.close();} ! catch (Exception e) {log("Exception while closing reader", Project.MSG_DEBUG);} } // Return messages. |