From 1bce0a66a11f4cbf8d6bcc46fbd9a36cb7ebe64a Mon Sep 17 00:00:00 2001 From: mattinger Date: Wed, 7 Mar 2007 21:25:39 +0000 Subject: Removing old stuff git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/branches/ant-1.7.0-upgrade@99 32d7a393-a5a9-423c-abd3-5d954feb1f2f --- .../sf/antcontrib/antclipse/ClassPathParser.java | 105 --------------------- 1 file changed, 105 deletions(-) delete mode 100644 src/java/net/sf/antcontrib/antclipse/ClassPathParser.java (limited to 'src/java/net/sf/antcontrib/antclipse/ClassPathParser.java') diff --git a/src/java/net/sf/antcontrib/antclipse/ClassPathParser.java b/src/java/net/sf/antcontrib/antclipse/ClassPathParser.java deleted file mode 100644 index 389c89e..0000000 --- a/src/java/net/sf/antcontrib/antclipse/ClassPathParser.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.antclipse; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.Location; -import org.xml.sax.HandlerBase; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -/** - * Classic tool firing a SAX parser. Must feed the source file and a handler. - * Nothing really special about it, only probably some special file handling in nasty cases - * (Windows files containing strange chars, internationalized filenames, - * but you shouldn't be doing this, anyway :)). - * @author Adrian Spinei aspinei@myrealbox.com - * @version $Revision: 1.2 $ - * @since Ant 1.5 - */ -public class ClassPathParser -{ - void parse(File file, HandlerBase handler) throws BuildException - { - String fName = file.getName(); - FileInputStream fileInputStream = null; - InputSource inputSource = null; - try - { - SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); - //go to UFS if we're on win - String uri = "file:" + fName.replace('\\', '/'); - fileInputStream = new FileInputStream(file); - inputSource = new InputSource(fileInputStream); - inputSource.setSystemId(uri); - saxParser.parse(inputSource, handler); - } - catch (ParserConfigurationException pceException) - { - throw new BuildException("Parser configuration failed", pceException); - } - catch (SAXParseException exc) - { - Location location = new Location(fName.toString(), exc.getLineNumber(), exc.getColumnNumber()); - Throwable throwable = exc.getException(); - if ((Object) throwable instanceof BuildException) - { - BuildException be = (BuildException) (Object) throwable; - if (be.getLocation() == Location.UNKNOWN_LOCATION) - be.setLocation(location); - throw be; - } - throw new BuildException(exc.getMessage(), throwable, location); - } - catch (SAXException exc) - { - Throwable throwable = exc.getException(); - if ((Object) throwable instanceof BuildException) - throw (BuildException) (Object) throwable; - throw new BuildException(exc.getMessage(), throwable); - } - catch (FileNotFoundException exc) - { - throw new BuildException(exc); - } - catch (IOException exc) - { - throw new BuildException("Error reading file", exc); - } - finally - { - if (fileInputStream != null) - { - try - { - fileInputStream.close(); - } - catch (IOException ioexception) - { - //do nothing, should not appear - } - } - } - } -} -- cgit v1.2.3