Merge pull request #4 from yacy/master

Get my fork synced #4
pull/42/head
Andreas 9 years ago
commit 898f6c5891

@ -29,15 +29,15 @@
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar"/>
<classpathentry kind="lib" path="lib/jaudiotagger-2.0.4-20111207.115108-15.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.18.jar"/>
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.18.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.18.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.4.4.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.8.1.jar"/>
<classpathentry kind="lib" path="lib/xmpcore-5.1.2.jar"/>
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>
<classpathentry kind="lib" path="lib/spatial4j-0.4.1.jar"/>
<classpathentry kind="lib" path="lib/spatial4j-0.5.jar"/>
<classpathentry kind="lib" path="lib/zookeeper-3.4.6.jar"/>
<classpathentry kind="lib" path="lib/org.restlet.jar"/>
<classpathentry kind="lib" path="lib/fontbox-1.8.11.jar"/>
@ -45,54 +45,54 @@
<classpathentry kind="lib" path="lib/pdfbox-1.8.11.jar"/>
<classpathentry kind="lib" path="lib/bcmail-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/poi-3.13-20150929.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.13-20150929.jar"/>
<classpathentry kind="lib" path="lib/poi-3.14-20160307.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.14-20160307.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.13.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.18.jar"/>
<classpathentry kind="lib" path="lib/chardet.jar"/>
<classpathentry kind="lib" path="lib/jetty-client-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-continuation-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-deploy-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-http-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-io-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-jmx-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-proxy-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-security-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-server-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlet-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlets-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-webapp-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/jetty-xml-9.2.14.v20151106.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.5.1.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.5.1.jar"/>
<classpathentry kind="lib" path="lib/jetty-client-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-continuation-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-deploy-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-http-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-io-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-jmx-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-proxy-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-security-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-server-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlet-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-servlets-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-webapp-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/jetty-xml-9.2.15.v20160210.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.5.2.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.5.2.jar"/>
<classpathentry kind="lib" path="lib/noggit-0.6.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/stax2-api-3.1.4.jar"/>
<classpathentry kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.4.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.5.0.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.5.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/icu4j-56_1.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.8.3.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="lib" path="lib/weupnp-0.1.3.jar"/>
<classpathentry kind="lib" path="lib/weupnp-0.1.4.jar"/>
<classpathentry kind="lib" path="lib/common-image-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/common-io-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/common-lang-3.2.1.jar"/>

39
.gitignore vendored

@ -1,19 +1,20 @@
*.class
*.*~
lib/yacycore.jar
libbuild/svnRevNr.jar
libbuild/GitRevTask.jar
gen/**
/DATA
classes/
RELEASE/
/yacy.pid
.DS_Store
lib/yacy-cora.jar
/DATA.bkp
/DATA.1
/gen
/api
/winDATA.bkp/
/DATA.cloud/
yacy.log
*.class
*.*~
lib/yacycore.jar
libbuild/svnRevNr.jar
libbuild/GitRevTask.jar
gen/**
/DATA
classes/
RELEASE/
/yacy.pid
.DS_Store
lib/yacy-cora.jar
/DATA.bkp
/DATA.1
/gen
/api
/winDATA.bkp/
/DATA.cloud/
yacy.log
/target/

@ -178,9 +178,9 @@
<pathelement location="${lib}/fontbox-1.8.11.jar" />
<pathelement location="${lib}/guava-18.0.jar" />
<pathelement location="${lib}/htmllexer.jar" />
<pathelement location="${lib}/httpclient-4.5.1.jar" />
<pathelement location="${lib}/httpclient-4.5.2.jar" />
<pathelement location="${lib}/httpcore-4.4.4.jar" />
<pathelement location="${lib}/httpmime-4.5.1.jar" />
<pathelement location="${lib}/httpmime-4.5.2.jar" />
<pathelement location="${lib}/icu4j-56_1.jar" />
<pathelement location="${lib}/imageio-bmp-3.2.1.jar" />
<pathelement location="${lib}/imageio-core-3.2.1.jar" />
@ -191,58 +191,58 @@
<pathelement location="${lib}/jaudiotagger-2.0.4-20111207.115108-15.jar" />
<pathelement location="${lib}/javax.servlet-api-3.1.0.jar" />
<pathelement location="${lib}/jcifs-1.3.17.jar" />
<pathelement location="${lib}/jcl-over-slf4j-1.7.13.jar" />
<pathelement location="${lib}/jcl-over-slf4j-1.7.18.jar" />
<pathelement location="${lib}/jempbox-1.8.11.jar" />
<pathelement location="${lib}/jetty-client-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-continuation-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-deploy-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-http-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-io-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-jmx-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-proxy-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-security-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-server-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-servlet-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-servlets-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-util-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-webapp-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-xml-9.2.14.v20151106.jar" />
<pathelement location="${lib}/jetty-client-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-continuation-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-deploy-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-http-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-io-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-jmx-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-proxy-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-security-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-server-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-servlet-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-servlets-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-util-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-webapp-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jetty-xml-9.2.15.v20160210.jar" />
<pathelement location="${lib}/jsch-0.1.53.jar" />
<pathelement location="${lib}/json-simple-1.1.1.jar" />
<pathelement location="${lib}/jsoup-1.8.3.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.7.13.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.4.0.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.4.0.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.4.0.jar" />
<pathelement location="${lib}/lucene-classification-5.4.0.jar" />
<pathelement location="${lib}/lucene-codecs-5.4.0.jar" />
<pathelement location="${lib}/lucene-core-5.4.0.jar" />
<pathelement location="${lib}/lucene-facet-5.4.0.jar" />
<pathelement location="${lib}/lucene-grouping-5.4.0.jar" />
<pathelement location="${lib}/lucene-highlighter-5.4.0.jar" />
<pathelement location="${lib}/lucene-join-5.4.0.jar" />
<pathelement location="${lib}/lucene-memory-5.4.0.jar" />
<pathelement location="${lib}/lucene-misc-5.4.0.jar" />
<pathelement location="${lib}/lucene-queries-5.4.0.jar" />
<pathelement location="${lib}/lucene-queryparser-5.4.0.jar" />
<pathelement location="${lib}/lucene-spatial-5.4.0.jar" />
<pathelement location="${lib}/lucene-suggest-5.4.0.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.7.18.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.5.0.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.5.0.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.5.0.jar" />
<pathelement location="${lib}/lucene-classification-5.5.0.jar" />
<pathelement location="${lib}/lucene-codecs-5.5.0.jar" />
<pathelement location="${lib}/lucene-core-5.5.0.jar" />
<pathelement location="${lib}/lucene-facet-5.5.0.jar" />
<pathelement location="${lib}/lucene-grouping-5.5.0.jar" />
<pathelement location="${lib}/lucene-highlighter-5.5.0.jar" />
<pathelement location="${lib}/lucene-join-5.5.0.jar" />
<pathelement location="${lib}/lucene-memory-5.5.0.jar" />
<pathelement location="${lib}/lucene-misc-5.5.0.jar" />
<pathelement location="${lib}/lucene-queries-5.5.0.jar" />
<pathelement location="${lib}/lucene-queryparser-5.5.0.jar" />
<pathelement location="${lib}/lucene-spatial-5.5.0.jar" />
<pathelement location="${lib}/lucene-suggest-5.5.0.jar" />
<pathelement location="${lib}/jsonic-1.2.0.jar" />
<pathelement location="${lib}/langdetect.jar" />
<pathelement location="${lib}/metadata-extractor-2.8.1.jar" />
<pathelement location="${lib}/noggit-0.5.jar" />
<pathelement location="${lib}/org.restlet.jar" />
<pathelement location="${lib}/pdfbox-1.8.11.jar" />
<pathelement location="${lib}/poi-3.13-20150929.jar" />
<pathelement location="${lib}/poi-scratchpad-3.13-20150929.jar" />
<pathelement location="${lib}/slf4j-api-1.7.13.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.13.jar" />
<pathelement location="${lib}/solr-core-5.4.0.jar" />
<pathelement location="${lib}/solr-solrj-5.4.0.jar" />
<pathelement location="${lib}/spatial4j-0.4.1.jar" />
<pathelement location="${lib}/poi-3.14-20160307.jar" />
<pathelement location="${lib}/poi-scratchpad-3.14-20160307.jar" />
<pathelement location="${lib}/slf4j-api-1.7.18.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.18.jar" />
<pathelement location="${lib}/solr-core-5.5.0.jar" />
<pathelement location="${lib}/solr-solrj-5.5.0.jar" />
<pathelement location="${lib}/spatial4j-0.5.jar" />
<pathelement location="${lib}/stax2-api_3.1.4.jar" />
<pathelement location="${lib}/webcat-swf-0.1.jar" />
<pathelement location="${lib}/weupnp-0.1.3.jar" />
<pathelement location="${lib}/weupnp-0.1.4.jar" />
<pathelement location="${lib}/woodstox-core-asl-4.4.1.jar" />
<pathelement location="${lib}/xercesImpl.jar" />
<pathelement location="${lib}/xml-apis.jar" />
@ -660,7 +660,6 @@
<java classname="net.yacy.yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
@ -680,7 +679,6 @@
<classpath refid="run.classpath"/>
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
@ -716,7 +714,6 @@
<java classname="net.yacy.yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>

@ -327,9 +327,6 @@ search.BlackLists=url.default.black
surftips.BlackLists=url.default.black
news.BlackLists=url.default.black
proxyCookieBlackList=cookie.default.black
proxyCookieWhiteList=cookie.default.black
# the blue-list;
# no search result is locally presented that has any word of the bluelist
# in the search words, the URL or the URL's description

@ -58,18 +58,13 @@ network.unit.remotecrawl.speed = 300
network.unit.bootstrap.seedlist0 = http://www.yacy.net/seed.txt
network.unit.bootstrap.seedlist1 = http://low.audioattack.de/yacy/seed.txt
network.unit.bootstrap.seedlist2 = http://sixcooler.de/yacy/seed.txt
network.unit.bootstrap.seedlist3 = http://fennec.cx/yacy/seed.txt
network.unit.bootstrap.seedlist4 = http://buelte.com/share/seed.txt
network.unit.bootstrap.seedlist5 = http://esbek.iv.net.pl/yacy/seed.txt
network.unit.bootstrap.seedlist6 = http://freenode.homeunix.org/yacy/seed.txt
network.unit.bootstrap.seedlist7 = http://yacy.tschability.ch/seed.txt
network.unit.bootstrap.seedlist8 = http://xz1.nl/yacy/seed.txt
network.unit.bootstrap.seedlist9 = http://massagefreun.de/yacy/seed.txt
network.unit.bootstrap.seedlist10 = http://yacy-vs2.db0anf.de/bootstrap/vs2-seed.txt
network.unit.bootstrap.seedlist11 = http://178.63.78.81:8090/www/seed.txt
network.unit.bootstrap.seedlist12 = http://188.243.64.125:37852/yacy/seed.txt
network.unit.bootstrap.seedlist13 = http://213.174.50.179/seed.txt
network.unit.bootstrap.seedlist14 = http://87.106.29.77:59465/seed.txt
network.unit.bootstrap.seedlist3 = http://yacyseed.underworld.fr/seed.txt
network.unit.bootstrap.seedlist4 = http://yacycalou.net:8090/seed.txt
network.unit.bootstrap.seedlist5 = http://yacyseed.fherb.de/seed.txt
network.unit.bootstrap.seedlist6 = http://fennec.cx/yacy/seed.txt
network.unit.bootstrap.seedlist7 = http://freenode.homeunix.org/yacy/seed.txt
network.unit.bootstrap.seedlist8 = http://yacy.tschability.ch/seed.txt
network.unit.bootstrap.seedlist9 = http://xz1.nl/yacy/seed.txt
# each network may use different yacy distributions.
# the auto-updater can access network-specific update locations

@ -0,0 +1,78 @@
# Network definition file for the freeworld network
# this is the default standard network for fresh YaCy Peers
# -----------------------------------------------------------------#
# for an explanation please see the file yacy.network.readme #
# this is a work in progress. disabled properties are not yet used #
# -----------------------------------------------------------------#
# define the name of the nework
# this nickname is also used to identifiy network requests
network.unit.name = zeronet
# the visible name of the network
network.unit.description = ZeroNet Search Index
# definition of the content domain: possible values are:
# global, local, any
network.unit.domain = any
# maximum search time for remote queries (milliseconds)
network.unit.remotesearch.maxtime = 3000
# maximum number of results per remote query
network.unit.remotesearch.maxcount = 10
# flag to switch on dht transmission
# if the dht transmission is set to 'false' then for a global
# query all targets are accessed
network.unit.dht = false
# the number of redundant target peers:
# redundant peers get a copy of the original dht target information
network.unit.dhtredundancy.junior = 1
network.unit.dhtredundancy.senior = 3
# the vertical partition of the dht: this applies a division
# of the dht into 2^^<partitionExponent> fragments which get
# all the same word-partition targets but a document-dht computed
# fragment of all documents
network.unit.dht.partitionExponent = 4
# network request burst attributes: this enables non-dht target
# positions for certain situations. This is not a 'traditional' burst-mode
# since it does not refer to a handshake to a single client but it refers
# to not-handshaking in a distributed way. It means to get data without using
# a dht transmission logic.
# switch to enable verification of search results
# must be set to true in untrusted networks and can be
# set to false in completely trusted networks
network.unit.inspection.searchverify = false
# speed of remote crawl de-queueing. this is the number of milliseconds
# as a pause between two requests
network.unit.remotecrawl.speed = 300
# addresses of seed-list bootstrap locations
network.unit.bootstrap.seedlist0 = http://search.yacy.net:7050/share/seed.txt
# each network may use different yacy distributions.
# the auto-updater can access network-specific update locations
network.unit.update.location0 = http://yacy.net/en/index.html
network.unit.update.location0.key = MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAbGeo21lW3Ost86RxSrCLIHaYaaj/68jFrTMjAORGJqUTgnvYCd4T1HmD/pCYrW8sQtN4KFPbm8M/MbDWeojQpy+qVqewBilYIdNpArGknvFkw4jpDPu7aR6FRz56zcZTnBiOpqAbBXDB3o6D1w9zVDPd4LBSTLgedt0joZeVAVk=
network.unit.update.location1 = http://kaskelix.de/update/
network.unit.update.location1.key = MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAbGeo21lW3Ost86RxSrCLIHaYaaj/68jFrTMjAORGJqUTgnvYCd4T1HmD/pCYrW8sQtN4KFPbm8M/MbDWeojQpy+qVqewBilYIdNpArGknvFkw4jpDPu7aR6FRz56zcZTnBiOpqAbBXDB3o6D1w9zVDPd4LBSTLgedt0joZeVAVk=
network.unit.update.location2 = http://latest.yacy.de/
network.unit.update.location2.key = MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAbGeo21lW3Ost86RxSrCLIHaYaaj/68jFrTMjAORGJqUTgnvYCd4T1HmD/pCYrW8sQtN4KFPbm8M/MbDWeojQpy+qVqewBilYIdNpArGknvFkw4jpDPu7aR6FRz56zcZTnBiOpqAbBXDB3o6D1w9zVDPd4LBSTLgedt0joZeVAVk=
# properties for in-protocol response authentication:
network.unit.protocol.control = uncontrolled
# white/blacklists
network.unit.access.whitelist = 10\..*,127\..*,172\.(1[6-9]|2[0-9]|3[0-1])\..*,169\.254\..*,192\.168\..*,localhost
network.unit.access.blacklist =
# greedy learning: fast information acquisition heuristic for new peers
greedylearning.enabled = false
greedylearning.limit.doccount = 1000

@ -2,4 +2,5 @@ defaults/yacy.network.freeworld.unit
defaults/yacy.network.webportal.unit
defaults/yacy.network.intranet.unit
defaults/yacy.network.allip.unit
defaults/yacy.network.metager.unit
defaults/yacy.network.metager.unit
defaults/yacy.network.zeronet.unit

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.yacy</groupId>
<artifactId>SimpleSearchClient</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<description>Simple search client example to query YaCy and receive search results as RSS feed</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
</project>

@ -23,18 +23,17 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
package net.yacy;
package net.yacy.simplesearchclient;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import net.yacy.cora.util.CommonPattern;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@ -55,6 +54,7 @@ public class YaCySearchClient {
private final String host, query;
private final int port;
private int offset;
private final static Pattern SPACE = Pattern.compile(" ");
public YaCySearchClient(final String host, final int port, final String query) {
this.host = host;
@ -80,7 +80,7 @@ public class YaCySearchClient {
.append("/yacysearch.rss?verify=false&startRecord=")
.append(YaCySearchClient.this.offset)
.append("&maximumRecords=10&resource=local&query=")
.append(CommonPattern.SPACE.matcher(YaCySearchClient.this.query).replaceAll("+")).toString();
.append(SPACE.matcher(YaCySearchClient.this.query).replaceAll("+")).toString();
try { url = new URL(u); } catch (final MalformedURLException e) { throw new IOException (e); }
try { doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(url.openStream()); }
catch (final ParserConfigurationException e) { throw new IOException (e); }
@ -131,14 +131,22 @@ public class YaCySearchClient {
* Use this method as stub for an integration in your own programs
*/
public static void main(String[] args) {
for (String query: args) try {
long t = System.currentTimeMillis();
YaCySearchClient search = new YaCySearchClient("localhost", 8090, query);
System.out.println("Search result for '" + query + "':");
System.out.print(search.next().toString()); // get 10 results; you may repeat this for next 10
System.out.println("Search Time: " + (System.currentTimeMillis() - t) + " milliseconds\n");
} catch (final IOException e) {
e.printStackTrace();
if (args.length < 1) {
System.out.println("No query string as argument found.");
System.out.println("Call the main method with one argument, the query string,");
System.out.println("while YaCy is running on localhost.");
} else {
for (String query : args) {
try {
long t = System.currentTimeMillis();
YaCySearchClient search = new YaCySearchClient("localhost", 8090, query);
System.out.println("Search result for '" + query + "':");
System.out.print(search.next().toString()); // get 10 results; you may repeat this for next 10
System.out.println("Search Time: " + (System.currentTimeMillis() - t) + " milliseconds\n");
} catch (final IOException e) {
e.printStackTrace();
}
}
}
}
}

@ -33,13 +33,14 @@
<li>
<img src="env/grafics/ok.png" height="16" width="16" alt="ok" />&nbsp;Select a language for the interface:<br />
<fieldset>
<input type="radio" name="language" value="default" id="lang_en" onchange="this.form.submit()" #(lang_en)#::checked="checked"#(/lang_en)# /><label for="lang_en">English</label>
<input type="radio" name="language" value="de" id="lang_de" onchange="this.form.submit()" #(lang_de)#::checked="checked"#(/lang_de)# /><label for="lang_de">Deutsch</label>&nbsp;
<input type="radio" name="language" value="fr" id="lang_fr" onchange="this.form.submit()" #(lang_fr)#::checked="checked"#(/lang_fr)# /><label for="lang_fr">Fran&ccedil;ais</label>&nbsp;
<input type="radio" name="language" value="cn" id="lang_cn" onchange="this.form.submit()" #(lang_cn)#::checked="checked"#(/lang_cn)# /><label for="lang_cn">&#27721;&#35821;/&#28450;&#35486</label>
<input type="radio" name="language" value="ru" id="lang_ru" onchange="this.form.submit()" #(lang_ru)#::checked="checked"#(/lang_ru)# /><label for="lang_ru">&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;</label>
<input type="radio" name="language" value="uk" id="lang_uk" onchange="this.form.submit()" #(lang_uk)#::checked="checked"#(/lang_uk)# /><label for="lang_uk">&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;</label>
<input type="radio" name="language" value="hi" id="lang_hi" onchange="this.form.submit()" #(lang_hi)#::checked="checked"#(/lang_hi)# /><label for="lang_hi">&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;</label>
<input type="radio" name="language" value="default" id="lang_en" onchange="this.form.submit()" #(lang_en)#::checked="checked"#(/lang_en)# /><label for="lang_en">English</label>
<input type="radio" name="language" value="ja" id="lang_ja" onchange="this.form.submit()" #(lang_ja)#::checked="checked"#(/lang_ja)# /><label for="lang_ja">&#26085;&#26412;&#35486;</label>
</fieldset>
</li>
<!-- take care that no other items are changed, but also change the former if no js is enabled -->

@ -275,6 +275,7 @@ public class ConfigBasic {
prop.put("lang_ru", "0");
prop.put("lang_uk", "0");
prop.put("lang_en", "0");
prop.put("lang_jp", "0");
if ("default".equals(lang)) {
prop.put("lang_en", "1");
} else {

@ -18,8 +18,8 @@
<form action="IndexExport_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Loaded URL Export</legend>
<dl>
<dt class="TableCellDark">Export File</dt>
<dd><input type="text" name="exportfile" value="#[exportfile]#" size="80" maxlength="250" />
<dt class="TableCellDark">Export Path</dt>
<dd><input type="text" name="exportfilepath" value="#[exportfilepath]#" size="120" maxlength="250" />
</dd>
<dt class="TableCellDark">URL Filter</dt>
<dd><input type="text" name="exportfilter" value=".*.*" size="20" maxlength="250" />
@ -27,6 +27,9 @@
<dt class="TableCellDark">query</dt>
<dd><input type="text" name="exportquery" value="*:*" size="20" maxlength="250" />
</dd>
<dt class="TableCellDark">maximum age (seconds, -1 = unlimited)</dt>
<dd><input type="text" name="exportmaxseconds" value="-1" size="20" maxlength="250" />
</dd>
<dt class="TableCellDark">Export Format</dt>
<dd>
<dl>

@ -22,10 +22,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import java.io.File;
import java.io.IOException;
import java.util.List;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.data.WorkTables;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Fulltext;
import net.yacy.search.index.Segment;
@ -53,9 +54,10 @@ public class IndexExport_p {
List<File> dumpFiles = segment.fulltext().dumpFiles();
prop.put("dumprestore_dumpfile", dumpFiles.size() == 0 ? "" : dumpFiles.get(dumpFiles.size() - 1).getAbsolutePath());
prop.put("dumprestore_optimizemax", 10);
prop.putNum("ucount", ucount);
// show export messages
final Fulltext.Export export = segment.fulltext().export();
Fulltext.Export export = segment.fulltext().export();
if ((export != null) && (export.isAlive())) {
// there is currently a running export
prop.put("lurlexport", 2);
@ -66,7 +68,7 @@ public class IndexExport_p {
prop.put("reload", 1);
} else {
prop.put("lurlexport", 1);
prop.put("lurlexport_exportfile", sb.getDataPath() + "/DATA/EXPORT/" + GenericFormatter.SHORT_SECOND_FORMATTER.format());
prop.put("lurlexport_exportfilepath", sb.getDataPath() + "/DATA/EXPORT/");
if (export == null) {
// there has never been an export
prop.put("lurlexportfinished", 0);
@ -87,7 +89,6 @@ public class IndexExport_p {
}
if (post == null || env == null) {
prop.putNum("ucount", ucount);
return prop; // nothing to do
}
@ -102,23 +103,28 @@ public class IndexExport_p {
if (fname.endsWith("rss")) format = Fulltext.ExportFormat.rss;
if (fname.endsWith("solr")) format = Fulltext.ExportFormat.solr;
// extend export file name
String s = post.get("exportfile", "");
if (s.indexOf('.',0) < 0) {
if (format == Fulltext.ExportFormat.text) s = s + ".txt";
if (format == Fulltext.ExportFormat.html) s = s + ".html";
if (format == Fulltext.ExportFormat.rss ) s = s + "_rss.xml";
if (format == Fulltext.ExportFormat.solr) s = s + "_full.xml";
}
final File f = new File(s);
f.getParentFile().mkdirs();
final String filter = post.get("exportfilter", ".*");
final String query = post.get("exportquery", "*:*");
final Fulltext.Export running = segment.fulltext().export(f, filter, query, format, dom, text);
final int maxseconds = post.getInt("exportmaxseconds", -1);
final String path = post.get("exportfilepath", "");
prop.put("lurlexport_exportfile", s);
prop.put("lurlexport_urlcount", running.count());
if ((running != null) && (running.failed() == null)) {
// store this call as api call: we do this even if there is a chance that it fails because recurring calls may do not fail
if (maxseconds != -1) sb.tables.recordAPICall(post, "IndexExport_p.html", WorkTables.TABLE_API_TYPE_DUMP, format + "-dump, q=" + query + ", maxseconds=" + maxseconds);
// start the export
try {
export = sb.index.fulltext().export(format, filter, query, maxseconds, new File(path), dom, text);
} catch (IOException e) {
prop.put("lurlexporterror", 1);
prop.put("lurlexporterror_exportfile", "-no export-");
prop.put("lurlexporterror_exportfailmsg", e.getMessage());
return prop;
}
// show result
prop.put("lurlexport_exportfile", export.file().toString());
prop.put("lurlexport_urlcount", export.count());
if ((export != null) && (export.failed() == null)) {
prop.put("lurlexport", 2);
}
prop.put("reload", 1);
@ -144,4 +150,4 @@ public class IndexExport_p {
return prop;
}
}
}

@ -221,14 +221,6 @@ public class Status
final long uptime = 60000 * sb.peers.mySeed().getLong(Seed.UPTIME, 0L);
prop.put("peerStatistics", "1");
prop.put("peerStatistics_uptime", PeerActions.formatInterval(uptime));
prop.putNum("peerStatistics_pagesperminute", sb.peers.mySeed().getPPM());
prop.putNum(
"peerStatistics_queriesperhour",
Math.round(6000d * sb.peers.mySeed().getQPM()) / 100d);
prop.putNum("peerStatistics_links", sb.peers.mySeed().getLinkCount());
prop.put("peerStatistics_words", Formatter.number(sb.peers.mySeed().getWordCount()));
prop.putNum("peerStatistics_disconnects", sb.peers.peerActions.disconnects);
prop.put("peerStatistics_connects", Formatter.number(sb.peers.mySeed().get(Seed.CCOUNT, "0")));
thisHash = sb.peers.mySeed().hash;
if ( sb.peers.mySeed().getIPs().size() == 0 ) {
prop.put("peerAddress", "0"); // not assigned + instructions

@ -137,7 +137,7 @@ public class ViewImage {
ImageInputStream imageInStream = null;
InputStream inStream = null;
try {
String urlExt = MultiProtocolURL.getFileExtension(url.getFileName());
String urlExt = MultiProtocolURL.getFileExtension(url.getFileName());
if (ext != null && ext.equalsIgnoreCase(urlExt) && isBrowserRendered(urlExt)) {
return openInputStream(post, sb.loader, auth, url);
}
@ -158,7 +158,7 @@ public class ViewImage {
* incorrect or unsupported format, bad ImageIO plugin...
* Instead return an empty EncodedImage. Caller is responsible for handling this correctly (500 status code response) */
if ("favicon.ico".equalsIgnoreCase(url.getFileName())) { // but on missing favicon just present a default (occures frequently by call from searchitem.html)
if (url != null && "favicon.ico".equalsIgnoreCase(url.getFileName())) { // but on missing favicon just present a default (occures frequently by call from searchitem.html)
// currently yacysearchitem assigns "hosturl/favicon.ico" (to look for the filename should not much interfere with other situatios)
if (defaulticonb == null) { // load the default icon once
try {

@ -117,7 +117,11 @@ public class WebStructurePicture_p {
for (int i = 0; i < hostlist.length; i++) {
String host = hostlist[i];
String hash = null;
try {hash = ASCII.String((new DigestURL("http://" + host)).hash(), 6, 6);} catch (final MalformedURLException e) {ConcurrentLog.logException(e);}
try {
hash = ASCII.String((new DigestURL("http://" + host)).hash(), 6, 6);
} catch (final MalformedURLException e) {
continue;
}
Map.Entry<String, String> centernode = new AbstractMap.SimpleEntry<String, String>(hash, host);
double angle = 2.0d * i * Math.PI / hostlist.length;
if (hostlist.length == 3) angle -= Math.PI / 2;

@ -74,7 +74,7 @@ public class push_p {
String collection = post.get("collection-" + i, "");
String lastModified = post.get("lastModified-" + i, ""); // must be in RFC1123 format
String contentType = post.get("contentType-" + i, "");
String data64 = post.get("data-" + i, ""); // file uploads are base64encoded in YaCyDefaultServlet.parseMultipart
String data64 = post.get("data-" + i + "$file", ""); // multi-file uploads are all base64-encoded in YaCyDefaultServlet.parseMultipart
byte[] data = Base64Order.standardCoder.decode(data64);
if ((data == null || data.length == 0) && data64.length() > 0) data = UTF8.getBytes(data64); // for test cases

@ -0,0 +1,47 @@
<html>
<head>
</head>
<body>
<h1>File Share</h1>
#(mode)#
<!-- mode = 0 - display an upload form -->
<p>This form can be used to share a (index) file</p>
<form id="push" action="share.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<dl>
<dt>Files to process:<dt>
<dt>&nbsp;<dt><dd>&nbsp;</dd>
<dd>
<dl>
<dt>data=</dt>
<dd><input name="data" type="file"></dd>
</dl>
</dd>
</dl>
<input type="submit" value="Submit">
</form>
::
<!-- mode 1 - display the push results -->
Result for the recently submitted file(s). You can also submit the same form using the servlet share.json to get push confirmations in json format.
<dl>
<dt>successall</dt><dd>#(successall)#false::true#(/successall)#</dd>
<dt>countsuccess</dt><dd>#[countsuccess]#</dd>
<dt>countfail</dt><dd>#[countfail]#</dd>
</dl>
<table border="1">
<tr><th>Item</th><th>URL</th><th>Success</th><th>Message</th></tr>
<tr>
<td>#[item]#</td>
<td><a href="#[url]#">#[url]#</a></td>
<td>#(success)#fail::ok#(/success)#</td>
<td>#(success)##[message]#::<a href="#[message]#" target="_blank">#[message]#</a>#(/success)#</td>
</tr>
</table>
<p>
If you want to push again files, use this form to pre-define a number of upload forms:
<form id="push" action="share.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<input name="c" type="text" value="1" size="4" maxlength="8"><input type="submit" value="Submit">
</form>
</p>
#(/mode)#
</body>
</html>

@ -0,0 +1,106 @@
/**
* share
* Copyright 2016 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany
* First released 24.02.2016 at http://yacy.net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program in the file lgpl21.txt
* If not, see <http://www.gnu.org/licenses/>.
*/
import java.io.File;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import net.yacy.yacy;
import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
import net.yacy.search.index.Fulltext;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
public class share {
/**
* Servlet to share any kind of binary to this peer.
* That mean you can upload 'things'. While this is the generic view,
* it will operate in the beginning only for full solr export files.
* The servlet will decide if it wants that kind of data and if the sender is valid,
* i.e. if the sender is within the own network and known.
* Index dumps which are uploaded are placed to a specific folder
* where they can be downloaded again by peers.
* An optional operation is the immediate indexing of the shared index.
* @param header
* @param post
* @param env
* @return
*/
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects();
// display mode: this only helps to display a nice input form for test cases
int c = post == null ? 1 : post.getInt("c", 0);
if (c > 0) {
prop.put("mode", 0);
return prop;
}
// push mode: this does a document upload
prop.put("mode", 1);
prop.put("success", 0);
if (post == null) return prop;
// check file name
String filename = post.get("data", "");
if (!filename.startsWith(Fulltext.yacy_dump_prefix) || !filename.endsWith(".xml.gz")) return prop;
// check data
String dataString = post.get("data$file", "");
if (dataString.length() == 0) return prop;
byte[] data;
if (filename.endsWith(".base64")) {
data = Base64Order.standardCoder.decode(dataString);
filename = filename.substring(0, filename.length() - 7);
} else {
data = UTF8.getBytes(dataString);
}
if (data == null || data.length == 0) return prop;
// modify the file name; ignore and replace the used transaction token
int ttp = filename.indexOf("_t");
if (ttp < 0) return prop;
if (filename.charAt(ttp + 3) != '.') return prop;
filename = filename.substring(0, ttp) + "_ts" + filename.substring(ttp + 3); // transaction token: 's' as 'shared'.
// process the data
File tmpFile = new File(yacy.shareDumpDefaultPath, filename + ".tmp");
File finalFile = new File(yacy.shareDumpDefaultPath, filename);
try {
Files.copy(new ByteArrayInputStream(data), tmpFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
tmpFile.renameTo(finalFile);
} catch (IOException e) {
ConcurrentLog.logException(e);
return prop;
}
prop.put("success", 1);
return prop;
}
}

@ -48,11 +48,11 @@ public class compare_yacy {
searchengines.put("metager2.de (web)", "http://www.metager2.de/search.php?ses=web&q=");
searchengines.put("metager2.de (international)", "http://www.metager2.de/search.php?ses=international&q=");
searchengines.put("yahoo.com", "http://search.yahoo.com/search?p=");
searchengines.put("romso.de", "http://romso.de/?q=");
//searchengines.put("romso.de", "http://romso.de/?q="); // no serach service 2016-01-02
searchengines.put("Wikipedia English", "http://en.wikipedia.org/wiki/");
searchengines.put("Wikipedia Deutsch", "http://de.wikipedia.org/wiki/");
searchengines.put("Sciencenet", "http://sciencenet.fzk.de:8080/yacysearch.html?verify=true&resource=global&nav=all&display=2&meanCount=5&query=");
searchengines.put("dbpedia", "http://dbpedia.neofonie.de/browse/~:");
//searchengines.put("dbpedia", "http://dbpedia.neofonie.de/browse/~:"); // no search service 2016-01-02
searchengines.put("wolfram alpha", "http://www.wolframalpha.com/input/?i=");
searchengines.put("OAIster@OCLC", "http://oaister.worldcat.org/search?q=");
searchengines.put("oai.yacy.net", "http://oai.yacy.net/yacysearch.html?verify=true&resource=local&nav=all&display=2&meanCount=5&query=");

@ -101,7 +101,7 @@
<ul class="nav nav-sidebar menugroup">
<li><h3>Administration</h3></li>
<li><a href="IndexControlURLs_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Index Administration</a></li>
<li><a href="Tables_p.html?table=robots&count=100" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">System Administration</a></li>
<li><a href="Settings_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">System Administration</a></li>
<li><a href="Blacklist_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Filter &amp; Blacklists</a></li>
<li><a href="Table_API_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Process Scheduler</a></li>
</ul>

@ -1,9 +1,9 @@
<div class="SubMenu">
<h3>System Administration</h3>
<ul class="SubMenu">
<li><a href="Tables_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Viewer and administration for database tables</a></li>
<li><a href="PerformanceQueues_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Performance Settings of Busy Queues</a></li>
<li><a href="Settings_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Advanced Settings</a></li>
<li><a href="PerformanceQueues_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Performance Settings of Busy Queues</a></li>
<li><a href="Tables_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Viewer and administration for database tables</a></li>
<li><a href="ConfigProperties_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Advanced Properties</a></li>
</ul>
</div>

@ -143,7 +143,7 @@ public class yacysearchitem {
if (authenticated) { // only needed if authorized
boolean bookmarkexists;
// check url exists in bookkmarks
bookmarkexists = sb.bookmarksDB.getBookmark(urlhash) != null;
bookmarkexists = sb.bookmarksDB.getBookmark(urlhash) != null;
prop.put("content_authorized_bookmark", !bookmarkexists);
// bookmark icon check for YMarks
//prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1");
@ -188,7 +188,6 @@ public class yacysearchitem {
prop.putXML("content_link", resultUrlstring); // putXML for rss
}
// prop.putHTML("content_value", Interaction.TripleGet(result.urlstring(), "http://virtual.x/hasvalue", "anonymous"));
// END interaction
boolean isAtomFeed = header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("atom");
@ -303,7 +302,7 @@ public class yacysearchitem {
boolean stealthmode = p2pmode && theSearch.query.isLocal();
if ((sb.getConfigBool(SwitchboardConstants.HEURISTIC_SEARCHRESULTS, false) ||
(sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ACTIVE, false) && sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ENABLED, false) && Memory.load() < 1.0)) &&
!stealthmode) sb.heuristicSearchResults(resultUrlstring);
!stealthmode) sb.heuristicSearchResults(result);
theSearch.query.transmitcount = item + 1;
return prop;
}

@ -26,7 +26,7 @@ Echo JRE Parameters:%javacmd%
Echo Startpath %~dp0
REM Install YaCy as Windows Service
%exepath%\prunsrv.exe //IS//YaCy --Jvm=auto --StartMode=jvm --StartClass=net.yacy.yacy --Classpath=htroot;lib/yacycore.jar --StartPath=%~dp0 --JvmOptions=%javaopts% --Startup=auto --JvmMx=%jmx% --JvmMs=%jms% --StopMode=jvm --StopClass=net.yacy.yacy --StopParams=-shutdown --Description=%servicedesc%
%exepath%\prunsrv.exe //IS//YaCy --Jvm=auto --StartMode=jvm --StartClass=net.yacy.yacy --Classpath=lib/yacycore.jar --StartPath=%~dp0 --JvmOptions=%javaopts% --Startup=auto --JvmMx=%jmx% --JvmMs=%jms% --StopMode=jvm --StopClass=net.yacy.yacy --StopParams=-shutdown --Description=%servicedesc%
if not errorlevel 1 goto installed
Echo Failed installing YaCy service

Binary file not shown.

@ -1,45 +0,0 @@
list of library-dependencies:
* jetty (these files were taken from the solr 3.6.0 example)
jetty-6.1.26-patched-JETTY-1340.jar
jetty-util-6.1.26-patched-JETTY-1340.jar
servlet-api-2.5-20081211.jar
* apache-solr-solrj-3.4.0.jar depends on:
commons-codec-1.4.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
jcl-over-slf4j-1.6.1.jar
slf4j-api-1.6.1.jar
wstx-asl-3.2.7.jar
* apache-solr-core-3.6.0.jar depends on
commons-codec-1.6.jar
commons-fileupload-1.2.1.jar
commons-httpclient-3.1.jar
commons-io-2.1.jar
commons-lang-2.6.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
guava-r05.jar
httpclient-4.3.6.jar
httpcore-4.3.3.jar
jcl-over-slf4j-1.6.1.jar
log4j-over-slf4j-1.6.1.jar
lucene-analyzers-3.6.0.jar
lucene-core-3.6.0.jar
lucene-highlighter-3.6.0.jar
lucene-phonetic-3.6.0.jar
lucene-spatial-3.6.0.jar
lucene-spellchecker-3.6.0.jar
slf4j-api-1.6.1.jar
slf4j-jdk14-1.6.1.jar
wstx-asl-3.2.7.jar
* pdfbox-1.8.5.jar depends on:
(see http://pdfbox.apache.org/dependencies.html)
fontbox-1.8.5.jar
jempbox-1.8.5.jar
bcprov-jdk15-1.44.jar
bcmail-jdk15-1.44.jar
icu4j.jar

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.yacy</groupId>
<artifactId>extlib</artifactId>
<version>1.0</version>
</parent>
<groupId>net.yacy.extlib</groupId>
<artifactId>J7Zip-modified</artifactId>
<packaging>jar</packaging>
<version>1.02</version>
<description>J7Zip library for YaCy sevenzipParser (not available in external maven repository)</description>
<licenses>
<license>
<name>GNU Lesser General Public License 2.1</name>
<url>http://www.gnu.org/licenses/lgpl-2.1.txt</url>
</license>
</licenses>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
</project>

@ -0,0 +1,101 @@
package Common;
import java.util.Collection;
import java.util.Iterator;
public class BoolVector {
protected boolean[] data;
int capacityIncr = 10;
int elt = 0;
public BoolVector() {
this.data = new boolean[10];
}
public BoolVector(int size) {
this.data = new boolean[size];
}
public int size() {
return elt;
}
public void ensureAdditionalCapacity(int addCapacity) {
ensureCapacity(data.length + addCapacity);
}
private void ensureCapacity(int minCapacity) {
int oldCapacity = data.length;
if (minCapacity > oldCapacity) {
boolean [] oldData = data;
int newCapacity = oldCapacity + capacityIncr;
if (newCapacity < minCapacity) {
newCapacity = minCapacity;
}
data = new boolean[newCapacity];
System.arraycopy(oldData, 0, data, 0, elt);
}
}
public boolean get(int index) {
if (index >= elt)
throw new ArrayIndexOutOfBoundsException(index);
return data[index];
}
public void Reserve(int s) {
ensureCapacity(s);
}
public void add(boolean b) {
ensureCapacity(elt + 1);
data[elt++] = b;
}
public void addAll(Collection c) {
ensureCapacity(elt + c.size());
Iterator it = c.iterator();
while (it.hasNext())
data[elt++] = ((Boolean)it.next()).booleanValue();
}
public void addAll(Boolean[] b) {
ensureCapacity(elt + b.length);
for (int i=0; i<b.length; i++)
data[elt++] = ((Boolean)b[i]).booleanValue();
}
public void set(int index, boolean value) {
if (index >= data.length)
throw new ArrayIndexOutOfBoundsException(index);
data[index] = value;
elt = index + 1;
}
public void setRange(int start, boolean value) {
setRange(start, data.length - start, value);
}
public void setRange(int start, int length, boolean value) {
if (start + length > data.length)
throw new ArrayIndexOutOfBoundsException("start = " + start + ", length = " + length);
for (int i=0; i<length; i++)
data[start + i] = value;
elt = start + length;
}
public void setBoolVector(BoolVector v) {
this.data = v.data;
this.elt = v.elt;
}
public void clear() {
elt = 0;
}
public boolean isEmpty() {
return elt == 0;
}
}

@ -0,0 +1,71 @@
package Common;
public class CRC {
public static final int[] Table = new int[256];
static {
for (int i = 0; i < 256; i++) {
int r = i;
for (int j = 0; j < 8; j++) {
if ((r & 1) != 0)
r = (r >>> 1) ^ 0xEDB88320;
else
r >>>= 1;
}
Table[i] = r;
}
}
int _value = -1;
public void Init() {
_value = -1;
}
public void UpdateByte(int b) {
_value = Table[(_value ^ b) & 0xFF] ^ (_value >>> 8);
}
public void UpdateUInt32(int v) {
for (int i = 0; i < 4; i++)
UpdateByte((v >> (8 * i)) & 0xFF );
}
public void UpdateUInt64(long v) {
for (int i = 0; i < 8; i++)
UpdateByte((int)((v >> (8 * i))) & 0xFF);
}
public int GetDigest() {
return _value ^ (-1);
}
public void Update(byte[] data, int size) {
for (int i = 0; i < size; i++)
_value = Table[(_value ^ data[i]) & 0xFF] ^ (_value >>> 8);
}
public void Update(byte[] data) {
for (int i = 0; i < data.length; i++)
_value = Table[(_value ^ data[i]) & 0xFF] ^ (_value >>> 8);
}
public void Update(byte[] data, int offset, int size) {
for (int i = 0; i < size; i++)
_value = Table[(_value ^ data[offset + i]) & 0xFF] ^ (_value >>> 8);
}
public static int CalculateDigest(byte [] data, int size) {
CRC crc = new CRC();
crc.Update(data, size);
return crc.GetDigest();
}
public static boolean VerifyDigest(int digest, byte [] data, int size) {
return (CalculateDigest(data, size) == digest);
}
public String toString() {
return Integer.toHexString(GetDigest());
}
}

@ -0,0 +1,129 @@
package Common;
import java.util.Collection;
import java.util.Iterator;
public class IntVector {
protected int[] data = new int[10];
int capacityIncr = 10;
int elt = 0;
public IntVector() {
}
public IntVector(int size) {
this.data = new int[size];
}
public int size() {
return elt;
}
public void ensureAdditionalCapacity(int addCapacity) {
ensureCapacity(data.length + addCapacity);
}
private void ensureCapacity(int minCapacity) {
int oldCapacity = data.length;
if (minCapacity > oldCapacity) {
int [] oldData = data;
int newCapacity = oldCapacity + capacityIncr;
if (newCapacity < minCapacity) {
newCapacity = minCapacity;
}
data = new int[newCapacity];
System.arraycopy(oldData, 0, data, 0, elt);
}
}
public int get(int index) {
if (index >= elt)
throw new ArrayIndexOutOfBoundsException(index);
return data[index];
}
public void Reserve(int s) {
ensureCapacity(s);
}
public void add(int b) {
ensureCapacity(elt + 1);
data[elt++] = b;
}
public void addAll(Collection c) {
ensureCapacity(elt + c.size());
Iterator it = c.iterator();
while (it.hasNext())
data[elt++] = ((Integer)it.next()).intValue();
}
public void addAll(Integer[] b) {
ensureCapacity(elt + b.length);
for (int i=0; i<b.length; i++)
data[elt++] = ((Integer)b[i]).intValue();
}
public void set(int index, int value) {
if (index >= data.length)
throw new ArrayIndexOutOfBoundsException(index);
data[index] = value;
elt = index + 1;
}
public void setRange(int start, int value) {
setRange(start, data.length - start, value);
}
public void setRange(int start, int length, int value) {
if (start + length > data.length)
throw new ArrayIndexOutOfBoundsException("start = " + start + ", length = " + length);
for (int i=0; i<length; i++)
data[start + i] = value;
elt = start + length;
}
public void clear() {
elt = 0;
}
public boolean isEmpty() {
return elt == 0;
}
public int Back() {
if (elt < 1)
throw new ArrayIndexOutOfBoundsException(0);
return data[elt-1];
}
public int Front() {
if (elt < 1)
throw new ArrayIndexOutOfBoundsException(0);
return data[0];
}
public void DeleteBack() {
// Delete(_size - 1);
remove(elt-1);
}
public int remove(int index) {
if (index >= elt)
throw new ArrayIndexOutOfBoundsException(index);
int oldValue = data[index];
int numMoved = elt - index - 1;
Integer n = new Integer(elt);
if (numMoved > 0)
System.arraycopy(n, index+1, n, index,numMoved);
elt = n.intValue();
// data[--elt] = null; // Let gc do its work
return oldValue;
}
}

@ -0,0 +1,54 @@
package Common;
import java.io.InputStream;
public class LimitedSequentialInStream extends InputStream {
final InputStream _stream; // ISequentialInStream
final long _size;
long _pos;
boolean _wasFinished;
public LimitedSequentialInStream(InputStream stream, long streamSize) {
_stream = stream;
_size = streamSize;
_pos = 0;
_wasFinished = false;
}
/*
public void SetStream(InputStream stream) { // ISequentialInStream
_stream = stream;
}
public void Init(long streamSize) {
_size = streamSize;
_pos = 0;
_wasFinished = false;
}*/
public int read() throws java.io.IOException {
int ret = _stream.read();
if (ret == -1) _wasFinished = true;
return ret;
}
public int read(byte [] data,int off, int size) throws java.io.IOException {
long sizeToRead2 = (_size - _pos);
if (size < sizeToRead2) sizeToRead2 = size;
int sizeToRead = (int)sizeToRead2;
if (sizeToRead > 0) {
int realProcessedSize = _stream.read(data, off, sizeToRead);
if (realProcessedSize == -1) {
_wasFinished = true;
return -1;
}
_pos += realProcessedSize;
return realProcessedSize;
}
return -1; // EOF
}
}

@ -0,0 +1,38 @@
package Common;
import java.io.IOException;
import SevenZip.IInStream;
public class LockedInStream {
final IInStream _stream;
public LockedInStream(IInStream stream) {
this._stream = stream;
}
/*
public void Init(IInStream stream) {
_stream = stream;
}*/
/* really too slow, don't use !
public synchronized int read(long startPos) throws java.io.IOException
{
// NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
_stream.Seek(startPos, IInStream.STREAM_SEEK_SET);
return _stream.read();
}
*/
public synchronized int read(long startPos, byte [] data, int size) throws IOException {
// NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
_stream.Seek(startPos, IInStream.STREAM_SEEK_SET);
return _stream.read(data,0, size);
}
public synchronized int read(long startPos, byte [] data, int off, int size) throws IOException {
// NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
_stream.Seek(startPos, IInStream.STREAM_SEEK_SET);
return _stream.read(data,off, size);
}
}

@ -0,0 +1,41 @@
package Common;
import java.io.InputStream;
public class LockedSequentialInStreamImp extends InputStream {
final LockedInStream _lockedInStream;
long _pos;
public LockedSequentialInStreamImp(LockedInStream lockedInStream, long startPos) {
_lockedInStream = lockedInStream;
_pos = startPos;
}
/*
public void Init(LockedInStream lockedInStream, long startPos) {
_lockedInStream = lockedInStream;
_pos = startPos;
}*/
public int read() throws java.io.IOException {
throw new java.io.IOException("LockedSequentialInStreamImp : read() not implemented");
/*
int ret = _lockedInStream.read(_pos);
if (ret == -1) return -1; // EOF
_pos += 1;
return ret;
*/
}
public int read(byte [] data, int off, int size) throws java.io.IOException {
int realProcessedSize = _lockedInStream.read(_pos, data,off, size);
if (realProcessedSize == -1) return -1; // EOF
_pos += realProcessedSize;
return realProcessedSize;
}
}

@ -0,0 +1,126 @@
package Common;
import java.util.Collection;
import java.util.Iterator;
public class LongVector {
protected long[] data = new long[10];
int capacityIncr = 10;
int elt = 0;
public LongVector() {
}
public int size() {
return elt;
}
public void ensureAdditionalCapacity(int addCapacity) {
ensureCapacity(data.length + addCapacity);
}
private void ensureCapacity(int minCapacity) {
int oldCapacity = data.length;
if (minCapacity > oldCapacity) {
long [] oldData = data;
int newCapacity = oldCapacity + capacityIncr;
if (newCapacity < minCapacity) {
newCapacity = minCapacity;
}
data = new long[newCapacity];
System.arraycopy(oldData, 0, data, 0, elt);
}
}
public long get(int index) {
if (index >= elt)
throw new ArrayIndexOutOfBoundsException(index);
return data[index];
}
public void Reserve(int s) {
ensureCapacity(s);
}
public void add(long b) {
ensureCapacity(elt + 1);
data[elt++] = b;
}
public void addAll(Collection c) {
ensureCapacity(elt + c.size());
Iterator it = c.iterator();
while (it.hasNext())
data[elt++] = ((Long)it.next()).longValue();
}
public void addAll(Long[] b) {
ensureCapacity(elt + b.length);
for (int i=0; i<b.length; i++)
data[elt++] = ((Long)b[i]).longValue();
}
public void set(int index, long value) {
if (index >= data.length)
throw new ArrayIndexOutOfBoundsException(index);
data[index] = value;
elt = index + 1;
}
public void setRange(int start, long value) {
setRange(start, data.length - start, value);
}
public void setRange(int start, int length, long value) {
if (start + length > data.length)
throw new ArrayIndexOutOfBoundsException("start = " + start + ", length = " + length);
for (int i=0; i<length; i++)
data[start + i] = value;
elt = start + length;
}
public void clear() {
elt = 0;
}
public boolean isEmpty() {
return elt == 0;
}
public long Back() {
if (elt < 1)
throw new ArrayIndexOutOfBoundsException(0);
return data[elt-1];
}
public long Front() {
if (elt < 1)
throw new ArrayIndexOutOfBoundsException(0);
return data[0];
}
public void DeleteBack() {
// Delete(_size - 1);
remove(elt-1);
}
// TODO
public long remove(int index) {
if (index >= elt)
throw new ArrayIndexOutOfBoundsException(index);
long oldValue = data[index];
int numMoved = elt - index - 1;
Integer n = new Integer(elt);
if (numMoved > 0)
System.arraycopy(n, index+1, n, index,numMoved);
elt = n.intValue();
// data[--elt] = null; // Let gc do its work
return oldValue;
}
}

@ -0,0 +1,98 @@
package SevenZip.Archive.Common;
import java.util.Vector;
import Common.IntVector;
public class BindInfo {
public Vector<CoderStreamsInfo> Coders = new Vector();
public Vector<BindPair> BindPairs = new Vector();
public IntVector InStreams = new IntVector();
public IntVector OutStreams = new IntVector();
public void Clear() {
Coders.clear();
BindPairs.clear();
InStreams.clear();
OutStreams.clear();
}
public int FindBinderForInStream(int inStream) {
for (int i = 0; i < BindPairs.size(); i++)
if (((BindPair)BindPairs.get(i)).InIndex == inStream)
return i;
return -1;
}
public int FindBinderForOutStream(int outStream) // const
{
for (int i = 0; i < BindPairs.size(); i++)
if (((BindPair)BindPairs.get(i)).OutIndex == outStream)
return i;
return -1;
}
public int GetCoderInStreamIndex(int coderIndex) // const
{
int streamIndex = 0;
for (int i = 0; i < coderIndex; i++)
streamIndex += ((CoderStreamsInfo)Coders.get(i)).NumInStreams;
return streamIndex;
}
public int GetCoderOutStreamIndex(int coderIndex) // const
{
int streamIndex = 0;
for (int i = 0; i < coderIndex; i++)
streamIndex += ((CoderStreamsInfo)Coders.get(i)).NumOutStreams;
return streamIndex;
}
/**
* @param streamIndex
* @return the coder index number
*/
public int FindInStream(int streamIndex) {
for (int i=0; i<Coders.size(); i++) {
int curSize = ((CoderStreamsInfo)Coders.get(i)).NumInStreams;
if (streamIndex < curSize) {
return i;
}
streamIndex -= curSize;
}
return -1; //throw new UnknownError("1");
}
/**
* @param streamIndex
* @return the coder index number
*/
public int FindOutStream(int streamIndex) {
for (int i=0; i<Coders.size(); i++) {
int curSize = ((CoderStreamsInfo)Coders.get(i)).NumOutStreams;
if (streamIndex < curSize)
return i;
streamIndex -= curSize;
}
return -1; //throw new UnknownError("1");
}
public boolean equals(Object obj) {
if (obj instanceof BindInfo) {
BindInfo arg = (BindInfo)obj;
if (this.Coders.size() != arg.Coders.size()) return false;
if (this.BindPairs.size() != arg.BindPairs.size()) return false;
if (this.InStreams.size() != arg.InStreams.size()) return false;
if (this.OutStreams.size() != arg.OutStreams.size()) return false;
int i;
for (i = 0; i < this.Coders.size(); i++)
if (!this.Coders.get(i).equals(arg.Coders.get(i))) return false;
for (i = 0; i < this.BindPairs.size(); i++)
if (!this.BindPairs.get(i).equals(arg.BindPairs.get(i))) return false;
return true;
}
return super.equals(obj);
}
}

@ -0,0 +1,19 @@
package SevenZip.Archive.Common;
public class BindPair {
public int InIndex;
public int OutIndex;
public BindPair() {
InIndex = 0;
OutIndex = 0;
}
public boolean equals(Object obj) {
if (obj instanceof BindPair) {
BindPair arg = (BindPair)obj;
return (this.InIndex == arg.InIndex) && (this.OutIndex == arg.OutIndex);
}
return super.equals(obj);
}
}

@ -0,0 +1,51 @@
package SevenZip.Archive.Common;
import SevenZip.ICompressCoder;
import SevenZip.ICompressCoder2;
import Common.LongVector;
public class CoderInfo {
ICompressCoder Coder;
ICompressCoder2 Coder2;
int NumInStreams;
int NumOutStreams;
LongVector InSizes = new LongVector();
LongVector OutSizes = new LongVector();
LongVector InSizePointers = new LongVector();
LongVector OutSizePointers = new LongVector();
public CoderInfo(int numInStreams, int numOutStreams) {
NumInStreams = numInStreams;
NumOutStreams = numOutStreams;
InSizes.Reserve(NumInStreams);
InSizePointers.Reserve(NumInStreams);
OutSizePointers.Reserve(NumOutStreams);
OutSizePointers.Reserve(NumOutStreams);
}
public static void SetSizes(
LongVector srcSizes,
LongVector sizes,
LongVector sizePointers,
int numItems) {
sizes.clear();
sizePointers.clear();
for(int i = 0; i < numItems; i++) {
if (srcSizes == null || srcSizes.get(i) == -1) // TBD null => -1
{
sizes.add(0L);
sizePointers.add(-1);
} else {
sizes.add(srcSizes.get(i)); // sizes.Add(*srcSizes[i]);
sizePointers.add(sizes.Back()); // sizePointers.Add(&sizes.Back());
}
}
}
public void SetCoderInfo(LongVector inSizes, LongVector outSizes) {
SetSizes(inSizes, InSizes, InSizePointers, NumInStreams);
SetSizes(outSizes, OutSizes, OutSizePointers, NumOutStreams);
}
}

@ -0,0 +1,12 @@
package SevenZip.Archive.Common;
import Common.LongVector;
public interface CoderMixer2 {
void ReInit();
// void setCoderInfos(Vector decoders, Folder folderInfo, LongVector packSizes);
void SetCoderInfo(int coderIndex,LongVector inSizes, LongVector outSizes);
}

@ -0,0 +1,270 @@
package SevenZip.Archive.Common;
import SevenZip.HRESULT;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Vector;
import Common.LongVector;
import SevenZip.ICompressCoder2;
import SevenZip.ICompressCoder;
import SevenZip.ICompressSetInStream;
import SevenZip.ICompressSetOutStream;
import SevenZip.ICompressSetOutStreamSize;
import SevenZip.ICompressProgressInfo;
public class CoderMixer2ST implements ICompressCoder2 , CoderMixer2 {
BindInfo _bindInfo = new BindInfo();
Vector<STCoderInfo> _coders = new Vector<STCoderInfo>();
int _mainCoderIndex;
public CoderMixer2ST(BindInfo bindInfo) {
this._bindInfo = bindInfo;
}
public void AddCoderCommon(boolean isMain) {
CoderStreamsInfo csi = _bindInfo.Coders.get(_coders.size());
_coders.add(new STCoderInfo(csi.NumInStreams, csi.NumOutStreams, isMain));
}
public void AddCoder2(ICompressCoder2 coder, boolean isMain) {
AddCoderCommon(isMain);
_coders.lastElement().Coder2 = coder;
}
public void AddCoder(ICompressCoder coder, boolean isMain) {
AddCoderCommon(isMain);
_coders.lastElement().Coder = coder;
}
@Override
public void ReInit() {
}
@Override
public void SetCoderInfo(int coderIndex,LongVector inSizes, LongVector outSizes) {
// _coders[coderIndex].SetCoderInfo(inSizes, outSizes);
_coders.get(coderIndex).SetCoderInfo(inSizes, outSizes);
}
public int GetInStream(
Vector<InputStream> inStreams,
//Object useless_inSizes, // const UInt64 **inSizes,
int streamIndex,
InputStream [] inStreamRes) {
InputStream seqInStream;
int i;
for(i = 0; i < _bindInfo.InStreams.size(); i++)
if (_bindInfo.InStreams.get(i) == streamIndex) {
seqInStream = inStreams.get(i);
inStreamRes[0] = seqInStream; // seqInStream.Detach();
return HRESULT.S_OK;
}
int binderIndex = _bindInfo.FindBinderForInStream(streamIndex);
if (binderIndex < 0)
return HRESULT.E_INVALIDARG;
int coderIndex = _bindInfo.FindOutStream(_bindInfo.BindPairs.get(binderIndex).OutIndex);
if (coderIndex < 0)
return HRESULT.E_INVALIDARG;
CoderInfo coder = _coders.get(coderIndex);
if (coder.Coder == null)
return HRESULT.E_NOTIMPL;
seqInStream = (InputStream)coder.Coder; // coder.Coder.QueryInterface(IID_ISequentialInStream, &seqInStream);
if (seqInStream == null)
return HRESULT.E_NOTIMPL;
int startIndex = _bindInfo.GetCoderInStreamIndex(coderIndex);
if (coder.Coder == null)
return HRESULT.E_NOTIMPL;
ICompressSetInStream setInStream = (ICompressSetInStream)coder.Coder; // coder.Coder.QueryInterface(IID_ICompressSetInStream, &setInStream);
if (setInStream == null)
return HRESULT.E_NOTIMPL;
if (coder.NumInStreams > 1)
return HRESULT.E_NOTIMPL;
for (i = 0; i < (int)coder.NumInStreams; i++) {
InputStream [] tmp = new InputStream[1];
int res = GetInStream(inStreams, /*useless_inSizes,*/ startIndex + i, tmp /* &seqInStream2 */ );
if (res != HRESULT.S_OK) return res;
InputStream seqInStream2 = tmp[0];
setInStream.SetInStream(seqInStream2);
//if (res != HRESULT.S_OK) return res;
}
inStreamRes[0] = seqInStream; // seqInStream.Detach();
return HRESULT.S_OK;
}
public int GetOutStream(
Vector<OutputStream> outStreams,
//Object useless_outSizes, // const UInt64 **outSizes,
int streamIndex,
OutputStream [] outStreamRes) {
OutputStream seqOutStream;
int i;
for(i = 0; i < _bindInfo.OutStreams.size(); i++)
if (_bindInfo.OutStreams.get(i) == streamIndex) {
seqOutStream = outStreams.get(i);
outStreamRes[0] = seqOutStream; // seqOutStream.Detach();
return HRESULT.S_OK;
}
int binderIndex = _bindInfo.FindBinderForOutStream(streamIndex);
if (binderIndex < 0)
return HRESULT.E_INVALIDARG;
int coderIndex = _bindInfo.FindInStream(_bindInfo.BindPairs.get(binderIndex).InIndex);
if (coderIndex < 0 )
return HRESULT.E_INVALIDARG;
CoderInfo coder = _coders.get(coderIndex);
if (coder.Coder == null)
return HRESULT.E_NOTIMPL;
try
{
seqOutStream = (OutputStream)coder.Coder; // coder.Coder.QueryInterface(IID_ISequentialOutStream, &seqOutStream);
} catch (java.lang.ClassCastException e) {
return HRESULT.E_NOTIMPL;
}
int startIndex = _bindInfo.GetCoderOutStreamIndex(coderIndex);
if (coder.Coder == null)
return HRESULT.E_NOTIMPL;
ICompressSetOutStream setOutStream = null;
try {
setOutStream = (ICompressSetOutStream)coder.Coder; // coder.Coder.QueryInterface(IID_ICompressSetOutStream, &setOutStream);
} catch (java.lang.ClassCastException e) {
return HRESULT.E_NOTIMPL;
}
if (coder.NumOutStreams > 1)
return HRESULT.E_NOTIMPL;
for (i = 0; i < (int)coder.NumOutStreams; i++) {
OutputStream [] tmp = new OutputStream[1];
int res = GetOutStream(outStreams, /*useless_outSizes,*/ startIndex + i, tmp /* &seqOutStream2 */ );
if (res != HRESULT.S_OK) return res;
OutputStream seqOutStream2 = tmp[0];
res = setOutStream.SetOutStream(seqOutStream2);
if (res != HRESULT.S_OK) return res;
}
outStreamRes[0] = seqOutStream; // seqOutStream.Detach();
return HRESULT.S_OK;
}
@Override
public int Code(
Vector<InputStream> inStreams,
//Object useless_inSizes, // const UInt64 ** inSizes ,
int numInStreams,
Vector<OutputStream> outStreams,
//Object useless_outSizes, // const UInt64 ** /* outSizes */,
int numOutStreams,
ICompressProgressInfo progress) throws IOException {
if (numInStreams != _bindInfo.InStreams.size() ||
numOutStreams != _bindInfo.OutStreams.size())
return HRESULT.E_INVALIDARG;
// Find main coder
int _mainCoderIndex = -1;
int i;
for (i = 0; i < _coders.size(); i++)
if (_coders.get(i).IsMain) {
_mainCoderIndex = i;
break;
}
if (_mainCoderIndex < 0)
for (i = 0; i < _coders.size(); i++)
if (_coders.get(i).NumInStreams > 1) {
if (_mainCoderIndex >= 0)
return HRESULT.E_NOTIMPL;
_mainCoderIndex = i;
}
if (_mainCoderIndex < 0)
_mainCoderIndex = 0;
// _mainCoderIndex = 0;
// _mainCoderIndex = _coders.Size() - 1;
CoderInfo mainCoder = _coders.get(_mainCoderIndex);
Vector<InputStream> seqInStreams = new Vector<InputStream>(); // CObjectVector< CMyComPtr<ISequentialInStream> >
Vector<OutputStream> seqOutStreams = new Vector<OutputStream>(); // CObjectVector< CMyComPtr<ISequentialOutStream> >
int startInIndex = _bindInfo.GetCoderInStreamIndex(_mainCoderIndex);
int startOutIndex = _bindInfo.GetCoderOutStreamIndex(_mainCoderIndex);
for (i = 0; i < (int)mainCoder.NumInStreams; i++) {
InputStream tmp [] = new InputStream[1];
int res = GetInStream(inStreams, /*useless_inSizes,*/ startInIndex + i, tmp /* &seqInStream */ );
if (res != HRESULT.S_OK) return res;
InputStream seqInStream = tmp[0];
seqInStreams.add(seqInStream);
}
for (i = 0; i < (int)mainCoder.NumOutStreams; i++) {
OutputStream tmp [] = new OutputStream[1];
int res = GetOutStream(outStreams, /*useless_outSizes,*/ startOutIndex + i, tmp);
if (res != HRESULT.S_OK) return res;
OutputStream seqOutStream = tmp[0];
seqOutStreams.add(seqOutStream);
}
Vector<InputStream> seqInStreamsSpec = new Vector<InputStream>();
Vector<OutputStream> seqOutStreamsSpec = new Vector<OutputStream>();
for (i = 0; i < (int)mainCoder.NumInStreams; i++)
seqInStreamsSpec.add(seqInStreams.get(i));
for (i = 0; i < (int)mainCoder.NumOutStreams; i++)
seqOutStreamsSpec.add(seqOutStreams.get(i));
for (i = 0; i < _coders.size(); i++) {
if (i == _mainCoderIndex)
continue;
CoderInfo coder = _coders.get(i);
ICompressSetOutStreamSize setOutStreamSize = null;
try
{
setOutStreamSize = (ICompressSetOutStreamSize)coder.Coder;
/*int res =*/ setOutStreamSize.SetOutStreamSize(coder.OutSizePointers.get(0));
//if (res != HRESULT.S_OK) return res;
} catch (java.lang.ClassCastException e) {
// nothing to do
}
}
if (mainCoder.Coder != null) {
/*int res =*/ mainCoder.Coder.Code(
seqInStreamsSpec.get(0),
seqOutStreamsSpec.get(0),
// TBD mainCoder.InSizePointers.get(0),
mainCoder.OutSizePointers.get(0),
progress);
//if (res != HRESULT.S_OK) return res;
} else {
/*int res =*/ mainCoder.Coder2.Code(
seqInStreamsSpec, // &seqInStreamsSpec.Front(
//mainCoder.InSizePointers.Front(), // &mainCoder.InSizePointers.Front()
mainCoder.NumInStreams,
seqOutStreamsSpec, // &seqOutStreamsSpec.Front()
//mainCoder.OutSizePointers.Front(), // &mainCoder.OutSizePointers.Front()
mainCoder.NumOutStreams,
progress);
//if (res != HRESULT.S_OK) return res;
}
OutputStream stream = seqOutStreams.firstElement();
stream.flush();
return HRESULT.S_OK;
}
@Override
public void close() {
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save