Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9315845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:27:57+00:00 2026-06-19T02:27:57+00:00

I understand that you cannot access java.io.File from a GAE app (its restricted). However,

  • 0

I understand that you cannot access java.io.File from a GAE app (its restricted). However, I remember reading somewhere that it’s possible to have access to anything in your WAR (perhaps anything under WEB-INF/?).

So I ask: is there a way to access a file inside your WAR from a GAE app? In other words, if I deploy a WAR with the following structure:

MyApp/
    WEB-INF/
        web.xml
        appengine-web.xml
        ...etc.

        my-special-config.xml

Is there any way for me to read my-special-config.xml from inside my GAE app? If so, how and with what classes? I see in the GAE SDK that there is an AppEngineFile, and wondering if I can use this. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T02:27:58+00:00Added an answer on June 19, 2026 at 2:27 am

    Check out the dev guide here:

    The Filesystem

    A Java application cannot use any classes used to write to the filesystem, such as java.io.FileWriter. An application can read its own files from the filesystem using classes such as java.io.FileReader. An application can also access its own files as "resources", such as with Class.getResource() or ServletContext.getResource().

    Only files that are considered "resource files" are accessible to the application via the filesystem. By default, all files in the WAR are "resource files." You can exclude files from this set using the appengine-web.xml file.

    Sample code to read resource file under classpath in POJO class:

    String file = "/WEB-INF/my-special-config.xml";
    InputStream in = getClass().getResourceAsStream(file);
    

    Sample code to read resource file under classpath in Servlet class:

    String file = "/WEB-INF/my-special-config.xml";
    InputStream in = getServletContext().getResourceAsStream(file);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading a question on @private I understand how that works. However, since all
This works in Access. I understand that you cannot use the NZ function with
I seem not to understand the protected access modifier From reading the msdn, it
I understand that I cannot add preconditions on an interface implementation. I have to
I understand that we can set the various style attributes from code behind using
If the end_user cannot access the source code of the app, why we still
I'm trying to understand if it's possible to access a Google Drive from a
I am getting this error: The process cannot access the file (...) because it
Good morning I am learning Java and trying to understand the access to class
I am studying a MIPS code that uses procedure but I can not understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.