Tobias Krais wrote:
Hi Guiseppe,

Now my questions, keeping in mind that at a certain time I need to
access the "META-INF" substorage to manipulate a custom file (read and
write).

I did not read the whole Thread. Here an Idea, how to get your needed path:
-----%<-----
// Return value
String currentPath = null;

// Get URL of the class
URL sourceURL = TheJudasConfigHandler.class.getProtectionDomain()
                .getCodeSource().getLocation();

URI sourceURI;
try {
        sourceURI = new URI(sourceURL.toString());
        File source = new File(sourceURI);
        if (source.getCanonicalPath().toString().endsWith(".jar")) {
                // If this class is located within a JAR File, get the
                // path of it
                currentPath = source.getParentFile().getCanonicalPath()
                                + File.separator;
        } else {
                currentPath = source.getCanonicalPath()
                                + File.separator;
        }
} catch (URISyntaxException e) {
        throw new Exception(e);
} catch (IOException e) {
        throw new Exception(e);
}

File globalConfigPath = new File(new File(currentPath)
                .getParent() + System.getProperty("file.separator")
                + "META-INF" + System.getProperty("file.separator"));
-----%<-----

mm, not sure if you are talking about the same 'package'. The substorage I'm referring to is embedded in the document (.odt, .ods, etc...) of an OOo document.

--
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
giuseppe.casta...@acca-esse.eu
beppe...@openoffice.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to