<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Barretj</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Barretj"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Barretj"/>
	<updated>2026-11-09T11:36:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68484</id>
		<title>API/Samples/Java/Office/ReadFilesFromOxt</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68484"/>
		<updated>2008-02-28T18:21:57Z</updated>

		<summary type="html">&lt;p&gt;Barretj: removed extra space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:API]] [[Category:Samples]] [[Category:Java]] [[Category:Office]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
This example shows how to read files that are contained within your .oxt package at runtime.&lt;br /&gt;
&lt;br /&gt;
Here is some code that you can add to your project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    private String[] getFileList() {&lt;br /&gt;
        try {&lt;br /&gt;
            XPackageInformationProvider xPackageInformationProvider = PackageInformationProvider.get(m_xContext);&lt;br /&gt;
            String location = xPackageInformationProvider.getPackageLocation(&amp;quot;org.openoffice.example&amp;quot;);&lt;br /&gt;
            Object oTransformer = m_xContext.getServiceManager().createInstanceWithContext(&amp;quot;com.sun.star.util.URLTransformer&amp;quot;, m_xContext);&lt;br /&gt;
            XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(XURLTransformer.class, oTransformer);&lt;br /&gt;
            com.sun.star.util.URL[] oURL = new com.sun.star.util.URL[1];&lt;br /&gt;
            oURL[0] = new com.sun.star.util.URL();&lt;br /&gt;
            oURL[0].Complete = location + &amp;quot;/some_sub_directory&amp;quot;;&lt;br /&gt;
            xTransformer.parseStrict(oURL);&lt;br /&gt;
            return new File(oURL[0].Path + oURL[0].Name).list();&lt;br /&gt;
        } catch (com.sun.star.uno.Exception ex) {&lt;br /&gt;
            System.out.println(ex);&lt;br /&gt;
            System.out.println(ex.getStackTrace());&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method returns an array of &amp;#039;&amp;#039;&amp;#039;String&amp;#039;&amp;#039;&amp;#039;s containing the files in a subdirectory of your package.  Be sure to change &amp;quot;some_sub_directory&amp;quot; to the actual name of the subdirectory, or leave it blank to get a list of files at the top level.  Also, change &amp;quot;org.openoffice.example&amp;quot; to the Extension Identifier of your package.  If you&amp;#039;re using Netbeans, you can get the Extension Identifier by right-clicking your project in the projects list and selecting OXT Extension properties, it&amp;#039;s under the Extension Management tab.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using Netbeans to build the .oxt file, you&amp;#039;ll want to add something like this to your build.xml file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;-post-uno-package&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;zip update=&amp;quot;true&amp;quot; destfile=&amp;quot;${uno.package.name}&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;zipfileset dir=&amp;quot;src/some_sub_directory&amp;quot; includes=&amp;quot;*&amp;quot; casesensitive=&amp;quot;yes&amp;quot; prefix=&amp;quot;some_sub_directory&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/zip&amp;gt;&lt;br /&gt;
    &amp;lt;/target&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This causes Netbeans to add the sub directory to your package when the .oxt file is built.&lt;/div&gt;</summary>
		<author><name>Barretj</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68483</id>
		<title>API/Samples/Java/Office/ReadFilesFromOxt</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68483"/>
		<updated>2008-02-28T18:21:30Z</updated>

		<summary type="html">&lt;p&gt;Barretj: Added categories.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:API]] [[Category:Samples]] [[Category:Java]] [[Category:Office]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows how to read files that are contained within your .oxt package at runtime.&lt;br /&gt;
&lt;br /&gt;
Here is some code that you can add to your project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    private String[] getFileList() {&lt;br /&gt;
        try {&lt;br /&gt;
            XPackageInformationProvider xPackageInformationProvider = PackageInformationProvider.get(m_xContext);&lt;br /&gt;
            String location = xPackageInformationProvider.getPackageLocation(&amp;quot;org.openoffice.example&amp;quot;);&lt;br /&gt;
            Object oTransformer = m_xContext.getServiceManager().createInstanceWithContext(&amp;quot;com.sun.star.util.URLTransformer&amp;quot;, m_xContext);&lt;br /&gt;
            XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(XURLTransformer.class, oTransformer);&lt;br /&gt;
            com.sun.star.util.URL[] oURL = new com.sun.star.util.URL[1];&lt;br /&gt;
            oURL[0] = new com.sun.star.util.URL();&lt;br /&gt;
            oURL[0].Complete = location + &amp;quot;/some_sub_directory&amp;quot;;&lt;br /&gt;
            xTransformer.parseStrict(oURL);&lt;br /&gt;
            return new File(oURL[0].Path + oURL[0].Name).list();&lt;br /&gt;
        } catch (com.sun.star.uno.Exception ex) {&lt;br /&gt;
            System.out.println(ex);&lt;br /&gt;
            System.out.println(ex.getStackTrace());&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method returns an array of &amp;#039;&amp;#039;&amp;#039;String&amp;#039;&amp;#039;&amp;#039;s containing the files in a subdirectory of your package.  Be sure to change &amp;quot;some_sub_directory&amp;quot; to the actual name of the subdirectory, or leave it blank to get a list of files at the top level.  Also, change &amp;quot;org.openoffice.example&amp;quot; to the Extension Identifier of your package.  If you&amp;#039;re using Netbeans, you can get the Extension Identifier by right-clicking your project in the projects list and selecting OXT Extension properties, it&amp;#039;s under the Extension Management tab.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using Netbeans to build the .oxt file, you&amp;#039;ll want to add something like this to your build.xml file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;-post-uno-package&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;zip update=&amp;quot;true&amp;quot; destfile=&amp;quot;${uno.package.name}&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;zipfileset dir=&amp;quot;src/some_sub_directory&amp;quot; includes=&amp;quot;*&amp;quot; casesensitive=&amp;quot;yes&amp;quot; prefix=&amp;quot;some_sub_directory&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/zip&amp;gt;&lt;br /&gt;
    &amp;lt;/target&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This causes Netbeans to add the sub directory to your package when the .oxt file is built.&lt;/div&gt;</summary>
		<author><name>Barretj</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68482</id>
		<title>API/Samples/Java/Office/ReadFilesFromOxt</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68482"/>
		<updated>2008-02-28T18:19:03Z</updated>

		<summary type="html">&lt;p&gt;Barretj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows how to read files that are contained within your .oxt package at runtime.&lt;br /&gt;
&lt;br /&gt;
Here is some code that you can add to your project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    private String[] getFileList() {&lt;br /&gt;
        try {&lt;br /&gt;
            XPackageInformationProvider xPackageInformationProvider = PackageInformationProvider.get(m_xContext);&lt;br /&gt;
            String location = xPackageInformationProvider.getPackageLocation(&amp;quot;org.openoffice.example&amp;quot;);&lt;br /&gt;
            Object oTransformer = m_xContext.getServiceManager().createInstanceWithContext(&amp;quot;com.sun.star.util.URLTransformer&amp;quot;, m_xContext);&lt;br /&gt;
            XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(XURLTransformer.class, oTransformer);&lt;br /&gt;
            com.sun.star.util.URL[] oURL = new com.sun.star.util.URL[1];&lt;br /&gt;
            oURL[0] = new com.sun.star.util.URL();&lt;br /&gt;
            oURL[0].Complete = location + &amp;quot;/some_sub_directory&amp;quot;;&lt;br /&gt;
            xTransformer.parseStrict(oURL);&lt;br /&gt;
            return new File(oURL[0].Path + oURL[0].Name).list();&lt;br /&gt;
        } catch (com.sun.star.uno.Exception ex) {&lt;br /&gt;
            System.out.println(ex);&lt;br /&gt;
            System.out.println(ex.getStackTrace());&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method returns an array of &amp;#039;&amp;#039;&amp;#039;String&amp;#039;&amp;#039;&amp;#039;s containing the files in a subdirectory of your package.  Be sure to change &amp;quot;some_sub_directory&amp;quot; to the actual name of the subdirectory, or leave it blank to get a list of files at the top level.  Also, change &amp;quot;org.openoffice.example&amp;quot; to the Extension Identifier of your package.  If you&amp;#039;re using Netbeans, you can get the Extension Identifier by right-clicking your project in the projects list and selecting OXT Extension properties, it&amp;#039;s under the Extension Management tab.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using Netbeans to build the .oxt file, you&amp;#039;ll want to add something like this to your build.xml file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;-post-uno-package&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;zip update=&amp;quot;true&amp;quot; destfile=&amp;quot;${uno.package.name}&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;zipfileset dir=&amp;quot;src/some_sub_directory&amp;quot; includes=&amp;quot;*&amp;quot; casesensitive=&amp;quot;yes&amp;quot; prefix=&amp;quot;some_sub_directory&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/zip&amp;gt;&lt;br /&gt;
    &amp;lt;/target&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This causes Netbeans to add the sub directory to your package when the .oxt file is built.&lt;br /&gt;
&lt;br /&gt;
[[Category:Category name]]&lt;/div&gt;</summary>
		<author><name>Barretj</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68481</id>
		<title>API/Samples/Java/Office/ReadFilesFromOxt</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=API/Samples/Java/Office/ReadFilesFromOxt&amp;diff=68481"/>
		<updated>2008-02-28T18:15:13Z</updated>

		<summary type="html">&lt;p&gt;Barretj: created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows how to read files that are contained within your .oxt package at runtime.&lt;br /&gt;
&lt;br /&gt;
Here is some code that you can add to your project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    private String[] getFileList() {&lt;br /&gt;
        try {&lt;br /&gt;
            XPackageInformationProvider xPackageInformationProvider = PackageInformationProvider.get(m_xContext);&lt;br /&gt;
            String location = xPackageInformationProvider.getPackageLocation(&amp;quot;org.openoffice.example&amp;quot;);&lt;br /&gt;
            Object oTransformer = m_xContext.getServiceManager().createInstanceWithContext(&amp;quot;com.sun.star.util.URLTransformer&amp;quot;, m_xContext);&lt;br /&gt;
            XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(XURLTransformer.class, oTransformer);&lt;br /&gt;
            com.sun.star.util.URL[] oURL = new com.sun.star.util.URL[1];&lt;br /&gt;
            oURL[0] = new com.sun.star.util.URL();&lt;br /&gt;
            oURL[0].Complete = location + &amp;quot;/some_sub_directory&amp;quot;;&lt;br /&gt;
            xTransformer.parseStrict(oURL);&lt;br /&gt;
            return new File(oURL[0].Path + oURL[0].Name).list();&lt;br /&gt;
        } catch (com.sun.star.uno.Exception ex) {&lt;br /&gt;
            System.out.println(ex);&lt;br /&gt;
            System.out.println(ex.getStackTrace());&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method returns an array of &amp;#039;&amp;#039;&amp;#039;String&amp;#039;&amp;#039;&amp;#039;s containing the files in a subdirectory of your package.  Be sure to change &amp;quot;some_sub_directory&amp;quot; to the actual name of the subdirectory, or leave it blank to get a list of files at the top level.  Also, change &amp;quot;org.openoffice.example&amp;quot; to the Extension Identifier of your package.  If you&amp;#039;re using Netbeans, you can get the Extension Identifier by right-clicking your project in the projects list and selecting OXT Extension properties, it&amp;#039;s under the Extension Management tab.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using Netbeans to build the .oxt file, you&amp;#039;ll want to add something like this to your build.xml file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;-post-uno-package&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;zip update=&amp;quot;true&amp;quot; destfile=&amp;quot;${uno.package.name}&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;zipfileset dir=&amp;quot;src/some_sub_directory&amp;quot; includes=&amp;quot;*&amp;quot; casesensitive=&amp;quot;yes&amp;quot; prefix=&amp;quot;some_sub_directory&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/zip&amp;gt;&lt;br /&gt;
    &amp;lt;/target&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This causes Netbeans to add the sub directory to your package when the .oxt file is built.&lt;/div&gt;</summary>
		<author><name>Barretj</name></author>
	</entry>
</feed>