Return-Path: Delivered-To: apmail-incubator-uima-user-archive@locus.apache.org Received: (qmail 39129 invoked from network); 11 Aug 2008 09:37:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Aug 2008 09:37:56 -0000 Received: (qmail 35633 invoked by uid 500); 11 Aug 2008 09:37:52 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 35543 invoked by uid 500); 11 Aug 2008 09:37:52 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 35499 invoked by uid 99); 11 Aug 2008 09:37:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Aug 2008 02:37:51 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hannescarl@googlemail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Aug 2008 09:36:54 +0000 Received: by ug-out-1314.google.com with SMTP id m3so204184ugc.15 for ; Mon, 11 Aug 2008 02:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:in-reply-to:mime-version:content-type:references; bh=/VtN/FFkHeEQ/5JgNWYncEd7y8fU0svcGf8etmvFiGQ=; b=FemlJt8GkYVm56+2eMXNOVfOQ02Ii6fmIegrfklqPbiC3+hIFU5no/kY7VtNUtkyPH kcm75Z7qhtXo1ZK/E8+kQtdNxNqWk7ncGlnpqbEVu+c78xcsbJIgSzygoIw/X3iwKRv9 VXUVENfZOFvddQkpuEWP5F0pVzwm36ThlJjNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:in-reply-to:mime-version :content-type:references; b=ZWOF83Kd9EBLkJas3L4ouDitcNo4LlY8GSXCG9v1vuKg5ITLTp5dM65XzpPcO3dL3i a8uHsf/+m58EeAi+XQ8Hd/TzvkJX4lrvI6C4sB2jw7t3aMJS/pnvFsGsZrK1lETN1yem Rd+GQaRlF9OQFLTRLp2yqwyyBu6TgR9HlqHhY= Received: by 10.67.106.13 with SMTP id i13mr2680874ugm.37.1218447440794; Mon, 11 Aug 2008 02:37:20 -0700 (PDT) Received: by 10.67.27.12 with HTTP; Mon, 11 Aug 2008 02:37:20 -0700 (PDT) Message-ID: <8b9ff1e40808110237r38cd450dtb2ea8b7ed378343f@mail.gmail.com> Date: Mon, 11 Aug 2008 11:37:20 +0200 From: "Hannes Carl Meyer" Reply-To: mail@hcmeyer.com To: uima-user@incubator.apache.org Subject: Re: Making JAR files reading from within In-Reply-To: <5cdd31570808081119y6c209136nb587aee0e786b4ad@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_46737_33376248.1218447440844" References: <5cdd31570808081119y6c209136nb587aee0e786b4ad@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_46737_33376248.1218447440844 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Ahmed, yes it is possible to access files from inside the jar, but in which context? In plain Java you can do something like this: YourClass.class.getClassLoader().getResourceAsStream("yourpackage/resource"); Regards Hannes 2008/8/8 Ahmed Abdeen Hamed > Hello,Is there a way to tell a jar file to access its contents (txt and > config) files instead of looking for such files on the filesystem? I > created > a UIMA-based application and it is successfully working from my machine > using the command-line. However, if I put the jar on another machine it > doesn't look inside itself to access model files for examples. I have been > looking into options and I found out that there is a way to access the > jars's internals one file at a time, and read it contents online at at > time. > However, that makes me reinvent my application again to get it to > manipulate > the files from the jars even though my program has already done that. Is > there a flag that you can turn on to tell the the jar to access its > contents > vs redoing this again programatically? > Thank you for you help! > -Ahmed > ------=_Part_46737_33376248.1218447440844--