<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Problem to access files in war</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120819590" />
  <subtitle>Problem to access files in war</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120819590</id>
  <updated>2026-04-04T12:38:27Z</updated>
  <dc:date>2026-04-04T12:38:27Z</dc:date>
  <entry>
    <title>RE: RE: Problem to access files in war</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120851320" />
    <author>
      <name>Eunice Silva</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120851320</id>
    <updated>2021-06-25T12:52:43Z</updated>
    <published>2021-06-25T12:52:43Z</published>
    <summary type="html">&lt;p&gt; &lt;span style="font-size: 11.0pt;"&gt;
    &lt;span style="line-height: 107.0%;"&gt;
      &lt;span style="font-family: Calibri , sans-serif;"&gt;I'm not trying to
        acess to &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;em&gt;
    &lt;span style="font-size: 11.0pt;"&gt;
      &lt;span style="background: white;"&gt;
        &lt;span style="line-height: 107.0%;"&gt;
          &lt;span style="font-family: &amp;quot;Source Sans Pro&amp;quot; , sans-serif;"&gt;
            &lt;span style="color: rgb(51,51,51);"&gt;parameter.json, so I
              imagin that you are in rong place. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;</summary>
    <dc:creator>Eunice Silva</dc:creator>
    <dc:date>2021-06-25T12:52:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Problem to access files in war</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120851288" />
    <author>
      <name>Eunice Silva</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120851288</id>
    <updated>2021-06-25T11:19:09Z</updated>
    <published>2021-06-25T11:19:09Z</published>
    <summary type="html">&lt;p style="margin-bottom: 11.0px;"&gt;
  &lt;span style="font-size: 11.0pt;"&gt;
    &lt;span style="line-height: 107.0%;"&gt;
      &lt;span style="font-family: Calibri , sans-serif;"&gt;Accessing files
        in war and jar is possible with
        getClass.getResourceAsStream() like Olaf sad (or
        getClassLooder.getResourceAsStream()) . Just put the files in
        the right place, in WEB-INF/classes (if file path/filename start
        with “/” in GetClass). In my case they aren’t. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</summary>
    <dc:creator>Eunice Silva</dc:creator>
    <dc:date>2021-06-25T11:19:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: Problem to access files in war</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120844431" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120844431</id>
    <updated>2021-06-24T10:34:47Z</updated>
    <published>2021-06-24T10:34:47Z</published>
    <summary type="html">&lt;p&gt;You could never rely on a WAR file to be unzipped to disk - it just
  happens to be the default configuration for Tomcat, so that everybody
  uses this method and is shocked that there are other ways of accessing
  data embedded in JAR files (or WAR files for that matter).&lt;/p&gt;
&lt;p&gt;Class.getResourceAsStream() is your friend, for any resource that's
  bundled in your classpath and accessible to your classloader. If you
  desperately need it on disk, you'll have to extract it to a temporary
  directory yourself and use that location.&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2021-06-24T10:34:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: Problem to access files in war</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120843181" />
    <author>
      <name>Cruz Moore</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120843181</id>
    <updated>2021-06-22T14:41:21Z</updated>
    <published>2021-06-22T12:10:11Z</published>
    <summary type="html">&lt;p&gt;I faced similar kind of issue last time, I am still searching for
  some proper solution.&lt;/p&gt;</summary>
    <dc:creator>Cruz Moore</dc:creator>
    <dc:date>2021-06-22T12:10:11Z</dc:date>
  </entry>
  <entry>
    <title>RE: Problem to access files in war</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120821705" />
    <author>
      <name>Miranda Michel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120821705</id>
    <updated>2021-06-24T10:31:45Z</updated>
    <published>2021-06-08T06:24:46Z</published>
    <summary type="html">&lt;p&gt;Your question states you are attempting to access a file
  called &lt;em&gt;parameter.json&lt;/em&gt;, while your code excerpt
  shows &lt;em&gt;parameter&lt;strong&gt;s&lt;/strong&gt;.json&lt;/em&gt;. Perhaps that
  discrepancy indicates a typo in your source code?&lt;/p&gt;
&lt;p&gt;If not, there are various ways to access a file from the classpath in
  Spring, with the first step for each being to ensure the file is in
  the project's src/main/resources directory.&lt;/p&gt;</summary>
    <dc:creator>Miranda Michel</dc:creator>
    <dc:date>2021-06-08T06:24:46Z</dc:date>
  </entry>
  <entry>
    <title>Problem to access files in war</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120819589" />
    <author>
      <name>Eunice Silva</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120819589</id>
    <updated>2021-06-07T15:14:48Z</updated>
    <published>2021-06-07T15:14:48Z</published>
    <summary type="html">&lt;p style="margin-bottom: 11.0px;"&gt;
  &lt;span style="font-size: 11.0pt;"&gt;
    &lt;span style="line-height: 107.0%;"&gt;
      &lt;span style="font-family: Calibri , sans-serif;"&gt;I’m converting an
        war maven project from Liferay CE 6.2 to Liferay CE 7.3. In this
        project we access directly to files, mainly xsl but not only,
        and these files are inside the war. But now we cannot access
        them because the war is not unpacked / exploded like before, for
        example in Tomcat 7 webapps folder (in production we are using
        Liferay 6.2 in Glassfish). &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 11.0px;"&gt;
  &lt;span style="font-size: 11.0pt;"&gt;
    &lt;span style="line-height: 107.0%;"&gt;
      &lt;span style="font-family: Calibri , sans-serif;"&gt;Is there any
        solution without changing the base of the application? Can’t
        believe that this functionality disappeared… Am I missing
        something? &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 11.0px;"&gt;
  &lt;span style="font-size: 11.0pt;"&gt;
    &lt;span style="line-height: 107.0%;"&gt;
      &lt;span style="font-family: Calibri , sans-serif;"&gt;I am steel
        working in develop environment with bundle Liferay CE 7.3 GA6 -
        Tomcat. Is beaver in production environment will be the same? &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 11.0px;"&gt;
  &lt;span style="font-size: 11.0pt;"&gt;
    &lt;span style="line-height: 107.0%;"&gt;
      &lt;span style="font-family: Calibri , sans-serif;"&gt;I spouse this´s
        related to deploying changes also… For every change I made in a
        java class I must wait to deploy of all app in Liferay. That
        tacks a lot of time extra… From the little I've seen so far it
        seems to me that it's the same in a normal module created from
        scratch and with the Liferay IDE.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 11.0px;"&gt;
  &lt;span style="font-size: 11.0pt;"&gt;
    &lt;span style="line-height: 107.0%;"&gt;
      &lt;span style="font-family: Calibri , sans-serif;"&gt;Can anyone help
        me? Even if it is to point me in the way, give me some guidelines?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</summary>
    <dc:creator>Eunice Silva</dc:creator>
    <dc:date>2021-06-07T15:14:48Z</dc:date>
  </entry>
</feed>
