Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 70905 invoked from network); 9 Oct 2004 11:01:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Oct 2004 11:01:55 -0000 Received: (qmail 96665 invoked by uid 500); 9 Oct 2004 11:01:52 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 96598 invoked by uid 500); 9 Oct 2004 11:01:51 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 96577 invoked by uid 99); 9 Oct 2004 11:01:50 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 09 Oct 2004 04:01:49 -0700 Received: (qmail 70890 invoked by uid 1203); 9 Oct 2004 11:01:48 -0000 Date: 9 Oct 2004 11:01:48 -0000 Message-ID: <20041009110148.70889.qmail@minotaur.apache.org> From: dims@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/utils PropertyStore.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N dims 2004/10/09 04:01:47 Modified: contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/misc BuildFileGenerator.java contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/utils PropertyStore.java Log: Solidify assumptions in location of properties file Revision Changes Path 1.20 +9 -1 ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/misc/BuildFileGenerator.java Index: BuildFileGenerator.java =================================================================== RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/misc/BuildFileGenerator.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- BuildFileGenerator.java 2 Sep 2004 13:03:15 -0000 1.19 +++ BuildFileGenerator.java 9 Oct 2004 11:01:47 -0000 1.20 @@ -108,7 +108,15 @@ //out.write(" \n"); out.write(" \n"); - File tempfile = new File("./target/classes"); + + File tempfile = null; + if(file != null) { + tempfile = new File(file.getParent(), "classes"); + } + if(tempfile == null) { + tempfile = new File("./target/classes"); + } + out.write(" "); tempfile = new File("target/test-classes"); out.write(" "); 1.3 +177 -87 ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/utils/PropertyStore.java Index: PropertyStore.java =================================================================== RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/utils/PropertyStore.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PropertyStore.java 11 Aug 2004 09:18:30 -0000 1.2 +++ PropertyStore.java 9 Oct 2004 11:01:47 -0000 1.3 @@ -1,87 +1,177 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.geronimo.ews.ws4j2ee.utils; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Properties; - -import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants; - -/** - * @author hemapani@opensource.lk - */ -public class PropertyStore { - private Properties properties; - private File file; - public PropertyStore(){ - File baseDir = new File("."); - String path = baseDir.getAbsolutePath(); - if(path.endsWith("incubator-geronimo") - ||path.endsWith("incubator-geronimo\\") - ||path.endsWith("incubator-geronimo/")){ - path = new File("./modules/axis/").getAbsolutePath(); - } - file = new File(path,"target/"+GenerationConstants.WS4J2EE_PROPERTY_FILE); - - file.getParentFile().mkdirs(); - FileInputStream in = null; - System.out.println(file.getAbsolutePath() + " created .. "); - try { - properties = new Properties(); - if(file.exists()){ - in = new FileInputStream(file); - properties.load(in); - } - } catch (FileNotFoundException e) { - } catch (IOException e) { - }finally{ - try{ - if(in != null){ - in.close(); - } - }catch(Exception e){} - - } - } - public void store(String repository){ - properties.setProperty(GenerationConstants.MAVEN_LOCAL_REPOSITARY,repository); - FileOutputStream out = null; - try { - out = new FileOutputStream(file); - properties.store(out,"repository Location"); - } catch (FileNotFoundException e) { - } catch (IOException e) { - }finally{ - try{ - if(out != null){ - out.close(); - } - }catch(Exception e){} - } - } - - public static void main(String[] args){ - try{ - PropertyStore store = new PropertyStore(); - store.store(args[0]); - }catch(Exception e){} - } -} +/* + + * Copyright 2001-2004 The Apache Software Foundation. + + * + + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + + * You may obtain a copy of the License at + + * + + * http://www.apache.org/licenses/LICENSE-2.0 + + * + + * Unless required by applicable law or agreed to in writing, software + + * distributed under the License is distributed on an "AS IS" BASIS, + + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + + * See the License for the specific language governing permissions and + + * limitations under the License. + + */ + + + +package org.apache.geronimo.ews.ws4j2ee.utils; + + + +import java.io.File; + +import java.io.FileInputStream; + +import java.io.FileNotFoundException; + +import java.io.FileOutputStream; + +import java.io.IOException; + +import java.util.Properties; + + + +import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants; + + + +/** + + * @author hemapani@opensource.lk + + */ + +public class PropertyStore { + + private Properties properties; + + private File file; + + public PropertyStore(){ + + File baseDir = new File("."); + + String path = baseDir.getAbsolutePath(); + + if(path.endsWith("geronimo") + + ||path.endsWith("geronimo\\") + ||path.endsWith("geronimo/") + ||path.endsWith("trunk") + ||path.endsWith("trunk\\") + + ||path.endsWith("trunk/")){ + + path = new File("./modules/axis/").getAbsolutePath(); + + } + + file = new File(path,"target/"+GenerationConstants.WS4J2EE_PROPERTY_FILE); + + + + file.getParentFile().mkdirs(); + + FileInputStream in = null; + + System.out.println(file.getAbsolutePath() + " created .. "); + + try { + + properties = new Properties(); + + if(file.exists()){ + + in = new FileInputStream(file); + + properties.load(in); + + } + + } catch (FileNotFoundException e) { + + } catch (IOException e) { + + }finally{ + + try{ + + if(in != null){ + + in.close(); + + } + + }catch(Exception e){} + + + + } + + } + + public void store(String repository){ + + properties.setProperty(GenerationConstants.MAVEN_LOCAL_REPOSITARY,repository); + + FileOutputStream out = null; + + try { + + out = new FileOutputStream(file); + + properties.store(out,"repository Location"); + + } catch (FileNotFoundException e) { + + } catch (IOException e) { + + }finally{ + + try{ + + if(out != null){ + + out.close(); + + } + + }catch(Exception e){} + + } + + } + + + + public static void main(String[] args){ + + try{ + + PropertyStore store = new PropertyStore(); + + store.store(args[0]); + + }catch(Exception e){} + + } + +} +