Revision: 19953
http://sourceforge.net/p/gate/code/19953
Author: markagreenwood
Date: 2017-01-11 14:34:30 +0000 (Wed, 11 Jan 2017)
Log Message:
-----------
some cleaning up
Modified Paths:
--------------
gate/branches/sawdust2/gate-core/src/main/java/gate/Plugin.java
Removed Paths:
-------------
gate/branches/sawdust2/gate-core/src/main/java/gate/util/HtmlLinksExtractor.java
gate/branches/sawdust2/gate-core/src/main/java/gate/util/ProgressPrinter.java
gate/branches/sawdust2/gate-core/src/main/java/gate/util/Restriction.java
Modified: gate/branches/sawdust2/gate-core/src/main/java/gate/Plugin.java
===================================================================
--- gate/branches/sawdust2/gate-core/src/main/java/gate/Plugin.java
2017-01-11 02:23:22 UTC (rev 19952)
+++ gate/branches/sawdust2/gate-core/src/main/java/gate/Plugin.java
2017-01-11 14:34:30 UTC (rev 19953)
@@ -83,6 +83,7 @@
import gate.util.asm.Opcodes;
import gate.util.asm.Type;
import gate.util.asm.commons.EmptyVisitor;
+import gate.util.maven.SimpleMavenCache;
import gate.util.maven.SimpleModelResolver;
public abstract class Plugin {
@@ -416,7 +417,7 @@
private String group, artifact, version;
- private WorkspaceReader workspace;
+ private WorkspaceReader workspace = null;//new SimpleMavenCache(new
File("cache"));
public Maven(String group, String artifact, String version) {
this.group = group;
@@ -607,7 +608,6 @@
@Override
public String getName() {
return name;
- //return group+":"+artifact+":"+version;
}
}
Deleted:
gate/branches/sawdust2/gate-core/src/main/java/gate/util/HtmlLinksExtractor.java
===================================================================
---
gate/branches/sawdust2/gate-core/src/main/java/gate/util/HtmlLinksExtractor.java
2017-01-11 02:23:22 UTC (rev 19952)
+++
gate/branches/sawdust2/gate-core/src/main/java/gate/util/HtmlLinksExtractor.java
2017-01-11 14:34:30 UTC (rev 19953)
@@ -1,279 +0,0 @@
-/*
- * HtmlLinkExtractor.java
- *
- * Copyright (c) 1995-2012, The University of Sheffield. See the file
- * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- * This file is part of GATE (see http://gate.ac.uk/), and is free
- * software, licenced under the GNU Library General Public License,
- * Version 2, June 1991 (in the distribution as file licence.html,
- * and also available at http://gate.ac.uk/gate/licence.html).
- *
- * Cristian URSU, 16/Nov/2001
- *
- * $Id$
- */
-
-package gate.util;
-
-import java.io.*;
-import java.util.*;
-
-import javax.swing.text.BadLocationException;
-import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.HTMLEditorKit;
-import javax.swing.text.html.HTMLEditorKit.ParserCallback;
-import javax.swing.text.html.parser.ParserDelegator;
-
-/**
- * This class extracts links from HTML files.
- * <B>It has been hacked</B> to build the contents of
- * <A HREF="http://gate.ac.uk/sitemap.html">http://gate.ac.uk/sitemap.html</A>;
- * you <B>probably don't want to use it</B> for anything else!
- * <P>
- * Implements the behaviour of the HTML reader.
- * Methods of an object of this class are called by the HTML parser when
- * events will appear.
- */
-public class HtmlLinksExtractor extends ParserCallback {
-
- /** Debug flag */
- private static final boolean DEBUG = false;
-
- /** The tag currently being processed */
- private HTML.Tag currentTag = null;
-
- /** whether we've done a title before */
- static boolean firstTitle = true;
-
- /** will contain </UL> after first title */
- static String endUl = "";
-
- /** Name of the file we're currently processing */
- static String currFile = "";
-
- /** Path to the file we're currently processing */
- static String currPath = "";
-
- /** This method is called when the HTML parser encounts the beginning
- * of a tag that means that the tag is paired by an end tag and it's
- * not an empty one.
- */
- @Override
- public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) {
-
- currentTag = t;
- if (HTML.Tag.A == t){
- Out.pr("<LI><" + t);
- Enumeration<?> e = a.getAttributeNames();
- while(e.hasMoreElements()) {
- HTML.Attribute name = (HTML.Attribute) e.nextElement();
- String value = (String) a.getAttribute(name);
-
- if(name == HTML.Attribute.HREF) {
- if(
- value.startsWith("http:") || value.startsWith("HTTP:") ||
- value.startsWith("file:") || value.startsWith("FILE:") ||
- value.startsWith("mailto:") || value.startsWith("MAILTO:") ||
- value.startsWith("ftp:") || value.startsWith("FTP:")
- )
- Out.pr(" HREF=\"" + value + "\"");
- else { // if it is a relative path....
- Out.pr(" HREF=\"" + currPath + "/" + value + "\"");
- }
- }
- } // while
-
- Out.pr(">");
- }// End if
-
- if (HTML.Tag.TITLE == t){
- Out.pr(endUl + "<H3>");
- if(firstTitle) { firstTitle = false; endUl = "</UL>"; }
- }// End if
-
- }//handleStartTag
-
- private void printAttributes(MutableAttributeSet a){
- if (a == null) return;
- // Take all the attributes an put them into the feature map
- if (0 != a.getAttributeCount()){
- Enumeration<?> enumeration = a.getAttributeNames();
- while (enumeration.hasMoreElements()){
- Object attribute = enumeration.nextElement();
- Out.pr(" "+ attribute.toString() + "=\"" +
- a.getAttribute(attribute).toString()+"\"");
- }// End while
- }// End if
- }// printAttributes();
-
- /** This method is called when the HTML parser encounts the end of a tag
- * that means that the tag is paired by a beginning tag
- */
- @Override
- public void handleEndTag(HTML.Tag t, int pos){
- currentTag = null;
-
- if (HTML.Tag.A == t)
- Out.pr("</"+t+">\n");
- if (HTML.Tag.TITLE == t)
- Out.pr(
- "</H3></A>\n\n<P>Links in: <A HREF=\"" + currFile +
- "\">" + currFile + "</A>:\n<UL>\n"
- );
-
- }//handleEndTag
-
- /** This method is called when the HTML parser encounts an empty tag
- */
- @Override
- public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos){
- if (HTML.Tag.A == t){
- Out.pr("<"+t);
- printAttributes(a);
- Out.pr("/>\n");
- }// End if
-
- if (HTML.Tag.TITLE == t){
- Out.pr("<"+t);
- printAttributes(a);
- Out.pr("/>\n");
- }// End if
- } // handleSimpleTag
-
- /** This method is called when the HTML parser encounts text (PCDATA)*/
- @Override
- public void handleText(char[] text, int pos){
-
- if(HTML.Tag.A == currentTag){
- //text of tag A
- String tagText = new String(text);
- Out.pr(tagText);
- }// End if
-
- if(HTML.Tag.TITLE == currentTag){
- //text of tag A
- String tagText = new String(text);
- Out.pr(tagText);
- }// End if
-
- }// end handleText();
-
- /**
- * This method is called when the HTML parser encounts an error
- * it depends on the programmer if he wants to deal with that error
- */
- @Override
- public void handleError(String errorMsg, int pos) {
- //Out.println ("ERROR CALLED : " + errorMsg);
- }
-
- /** This method is called once, when the HTML parser reaches the end
- * of its input streamin order to notify the parserCallback that there
- * is nothing more to parse.
- */
- @Override
- public void flush() throws BadLocationException{
- }// flush
-
- /** This method is called when the HTML parser encounts a comment
- */
- @Override
- public void handleComment(char[] text, int pos) {
- }
-
- /**
- * Given a certain folder it lists recursively all the files contained
- * in that folder. It returns a list of strings representing the file
- * names
- */
- private static List<String> listAllFiles(File aFile, Set<String>
foldersToIgnore){
- List<String> sgmlFileNames = new ArrayList<String>();
- List<File> foldersToExplore = new ArrayList<File>();
- if (!aFile.isDirectory()){
- // add the file to the file list
- sgmlFileNames.add(aFile.getPath());
- return sgmlFileNames;
- }// End if
- listFilesRec(aFile,sgmlFileNames,foldersToExplore, foldersToIgnore);
- return sgmlFileNames;
- } // listAllFiles();
-
- /** Helper method for listAllFiles */
- private static void listFilesRec(File aFile,
- List<String> fileNames,
- List<File> foldersToExplore,
- Set<String> foldersToIgnore){
-
- String[] fileList = aFile.list();
- for (int i=0; i< fileList.length; i++){
- File tmpFile = new File(aFile.getPath()+"\\"+fileList[i]);
- if (tmpFile.isDirectory()){
- // If the file is not included
- if (!foldersToIgnore.contains(tmpFile.getName())) { //fileList[i])) {
- if(DEBUG) {
- Err.prln("adding dir: " + tmpFile);
- Err.prln(" name: " + tmpFile.getName());
- }
- foldersToExplore.add(tmpFile);
- }
- }else{
- // only process .html files
- if(
- ( fileList[i].toLowerCase().endsWith(".html") ) ||
- ( fileList[i].toLowerCase().endsWith(".htm") )
- ) fileNames.add(tmpFile.getPath());
- }// End if
- }// End for
-
- while(!foldersToExplore.isEmpty()){
- File folder = foldersToExplore.get(0);
- foldersToExplore.remove(0);
- listFilesRec(folder,fileNames,foldersToExplore,foldersToIgnore);
- }//End while
-
- } // listFilesRec();
-
- /** Extract links from all .html files below a directory */
- public static void main(String[] args){
- HTMLEditorKit.Parser parser = new ParserDelegator();
- // create a new Htmldocument handler
- HtmlLinksExtractor htmlDocHandler = new HtmlLinksExtractor();
-
- if (args.length == 0){
- Out.prln(
- "Eg: java HtmlLinksExtractor g:\\tmp\\relative javadoc img >
results.txt"
- );
- return;
- }
- // Create a folder file File
- File htmlFolder = new File(args[0]);
- Set<String> foldersToIgnore = new HashSet<String>();
- for(int i = 1; i<args.length; i++)
- foldersToIgnore.add(args[i]);
-
- List<String> htmlFileNames = listAllFiles(htmlFolder,foldersToIgnore);
- //Collections.sort(htmlFileNames);
- while (!htmlFileNames.isEmpty()){
- try{
- String htmlFileName = htmlFileNames.get(0);
- currFile = htmlFileName;
- currPath = new File(currFile).getParent().toString();
- htmlFileNames.remove(0);
-
- Out.prln("\n\n<A HREF=\"file://" + htmlFileName + "\">");
- Reader reader = new FileReader(htmlFileName);
- // parse the HTML document
- parser.parse(reader, htmlDocHandler, true);
- } catch (IOException e){
- e.printStackTrace(System.out);
- }// End try
- }// End while
- System.err.println("done.");
- }// main
-
-}//End class HtmlLinksExtractor
-
-
-
Deleted:
gate/branches/sawdust2/gate-core/src/main/java/gate/util/ProgressPrinter.java
===================================================================
---
gate/branches/sawdust2/gate-core/src/main/java/gate/util/ProgressPrinter.java
2017-01-11 02:23:22 UTC (rev 19952)
+++
gate/branches/sawdust2/gate-core/src/main/java/gate/util/ProgressPrinter.java
2017-01-11 14:34:30 UTC (rev 19953)
@@ -1,90 +0,0 @@
-/*
- * ProgressPrinter.java
- *
- * Copyright (c) 1995-2012, The University of Sheffield. See the file
- * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- * This file is part of GATE (see http://gate.ac.uk/), and is free
- * software, licenced under the GNU Library General Public License,
- * Version 2, June 1991 (in the distribution as file licence.html,
- * and also available at http://gate.ac.uk/gate/licence.html).
- *
- * Valentin Tablan, 21/07/2000
- *
- * $Id$
- */
-
-package gate.util;
-
-import java.io.PrintStream;
-
-import gate.event.ProgressListener;
-
-
-/**
- * Class used to simulate the behaviour of a progress bar on an OutputStream.
- *
- */
-public class ProgressPrinter implements ProgressListener {
-
- /**
- * Constructor.
- *
- * @param out the stream used for output
- * @param numberOfSteps the number of steps until the process is over (the
- * number of characters printed for a full run)
- */
- public ProgressPrinter(PrintStream out, int numberOfSteps) {
- this.out = out;
- this.numberOfSteps = numberOfSteps;
- }
-
- /**
- * Constructor. Uses the default number of steps.
- *
- * @param out
- */
- public ProgressPrinter(PrintStream out) {
- this.out = out;
- }
-
- @Override
- public void processFinished() {
- for(int i = currentValue; i < numberOfSteps; i++) {
- out.print("#");
- }
- out.println("]");
- currentValue = 0;
- started = false;
- }
-
- @Override
- public void progressChanged(int newValue) {
- if(!started){
- out.print("[");
- started = true;
- }
- newValue = newValue * numberOfSteps / 100;
- if(newValue > currentValue){
- for(int i = currentValue; i < newValue; i++) {
- out.print("#");
- }
- currentValue = newValue;
- }
- }
-
- /** *
- */
- int currentValue = 0;
-
- /** *
- */
- int numberOfSteps = 70;
-
- /** */
- PrintStream out;
-
- /** */
- boolean started = false;
-
-} // class ProgressPrinter
Deleted:
gate/branches/sawdust2/gate-core/src/main/java/gate/util/Restriction.java
===================================================================
--- gate/branches/sawdust2/gate-core/src/main/java/gate/util/Restriction.java
2017-01-11 02:23:22 UTC (rev 19952)
+++ gate/branches/sawdust2/gate-core/src/main/java/gate/util/Restriction.java
2017-01-11 14:34:30 UTC (rev 19953)
@@ -1,71 +0,0 @@
-/*
- * Restriction.java
- *
- * Copyright (c) 1995-2012, The University of Sheffield. See the file
- * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- * This file is part of GATE (see http://gate.ac.uk/), and is free
- * software, licenced under the GNU Library General Public License,
- * Version 2, June 1991 (in the distribution as file licence.html,
- * and also available at http://gate.ac.uk/gate/licence.html).
- *
- * Rosen Marinov, 10/Dec/2001
- *
- * $Id$
- */
-
-package gate.util;
-
-import java.io.Serializable;
-
-public class Restriction implements Serializable{
-
- private static final long serialVersionUID = -1266771900567902681L;
-
- /* Type of operator for comparision in query*/
- public static final int OPERATOR_EQUATION = 100;
- public static final int OPERATOR_LESS = 101;
- public static final int OPERATOR_BIGGER = 102;
- public static final int OPERATOR_EQUATION_OR_BIGGER = 103;
- public static final int OPERATOR_EQUATION_OR_LESS = 104;
- public static final int OPERATOR_LIKE = 105;
-
- private Object value;
- private String key;
- private int operator_;
-
- /** Constructor.
- *
- * @param key string value of a feature key in document.
- * @param value value of a feature with this key
- * @param operator_ type of operator for comparison in query
- *
- */
- public Restriction(String key, Object value, int operator_){
- this.key = key;
- this.value = value;
- this.operator_ = operator_;
- }
-
- /**
- * @return Object value of feature
- */
- public Object getValue(){
- return value;
- }
-
- /** @return String string value og feature */
- public String getStringValue(){
- return value.toString();
- }
-
- /** @return String string value of the feature key */
- public String getKey(){
- return key;
- }
-
- /** @return int type of operator */
- public int getOperator(){
- return operator_;
- }
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs