GetResourceAsStream... what is a Resource?

I'm working on an applet that ships application data (lots of it) in jars. I'm using getResourceAsStream to read the resources from the jars and things seem to be 'fine' but I'm wondering why, everywhere I see samples of getResourceAsStream, its loading something cheap like property files or beep sounds. Is there some overhead to using this (that wouldn't exist with a normal zip file) that suggests that you would only use it for small files? Is it at all sane to put, say, a large MP4 in a jar and read it this way? Since this is an applet, this is by far the easiest way of transmitting static data but, if this is going to incur a heavy penalty when my data goes from 2K to 200M, I guess I'll soon have to find another solution.
Thanks,
- David

I would be very surprised if this method were significantly slower than using other straight forward means.
If in doubt I would test and see if it is fast enough for your needs.

Similar Messages

  • What are DE resources?

    ERR DE-421452038: Error initializing DE. Checking DE resources is recommended.
    ERR REP-0002: Unable to retrieve a string from the Report Builder message file.
    I am seeing the following error when running a batch of reports. Basically this report is being run as a batch job and simply being called over and over again. This error seems to pop up at random times, this latest time, right in the middle of a run (about half of the reports ran, then the other half all had this error). Without making any changes, I successfully ran all of the ones that failed just by calling them again. Does anyone have any insight on this mysterious ERR DE-421452038 message and what a DE resource might be? I've found the text "Error initializing DE. Checking DE resources is recommended" under a different error message: REP-3400 ( see link http://gwynne.cs.ualberta.ca/~oracle/dev6idoc/olddocs/r25/a32490/ch11.html ), but the only information it gives is "This is an abnormal condition". Well duh, no kidding huh? Love that Oracle documentation.
    null

    Hi,
    Not sure if this will help you, but DE stands for Development Environment, the common PL/SQL layer for Forms, Reports, Graphics and Procedure Builders.
    A problem with DE resources might happen when we use very large program units (>32K).
    However, if the failed reports are successfull at the second attempt, you are probably hitting an hardware/operating system resource problem.
    Pedro.

  • What is Consumer resource group ,ORacle services?

    Hi,
    Could any one can explain what is Consumer resource group and Oracle Services.??
    Thanks,
    Nats

    Hi Mohamed,
    To answer your questions:
    Q: What is parent resouce ID?
    ANS: In your data, you may have some tasks that are associated with another task i.e. child tasks of a parent task. That association would need to be held in a column of your database table, for example PARENT_ID. The value held in the PARENT_ID column would be the ID of the parent task that the current task is associated with. For example, on this page - http://apex.oracle.com/pls/apex/f?p=36648:86 - you can see that the 2nd task, "Update Application Wizard", is a child of the parent node "Charts Integration", and that association is based upon the value stored in the PARENT_ID column of my sample table.
    Q: Is it also mandatory? Can I create a gantt chart without it?
    ANS: No, it is not mandatory. However, the syntax of the query must include PARENT_ID, which you can of course set to NULL, as you can see in the following example:
    SELECT NULL LINK,
           RESOURCE_ID ID,
           TASK_NAME NAME,
           NULL PARENT_ID,
           START_DATE ACTUAL_START,
           END_DATE ACTUAL_END
    FROM   TASKS Below is another sample query, where you can see the PARENT_ID is being set. In this case, we want to represent a hierarchical task list
    SELECT 'f?p=4000:2:'||:APP_SESSION||':::P2_ID:'||ID LINK
           RESOURCE_ID ID,
           RESOURCE_NAME NAME,
           PARENT_ID PARENT_ID,
           START_DATE ACTUAL_START,
           END_DATE ACTUAL_END
    FROM   TASKSI hope this helps to clarify things.
    Regards,
    Hilary

  • What kind of resource demand does the standalone listener create?

    Hi all -
    I'm wondering what kind of resource load is consumed by the separating the listener off of the database. I guess I was under the impression the listener doesn't really do much at all other than handle the connections and calls to the database. Is it correct in assuming the majority of the resource consumption is still actually on the database or does the listener have a more impacting role?
    The question goes into determining what kind of processing power would be needed for a server that is only hosting the listener. Seeing as there really isn't anything that changes within the environment I'm wondering if it's really necessary to have multiple VM's setup for the sole purpose of hosting the listener. On that same note, is separating the listener onto a separate machine really removing any processing demand from the database?
    Thanks :)

    Hi,
    it seems you mixed up the database listener with APEX Listener. The APEX Listener is not an alternative for the database listener (you'll still need it when using the APEX Listener), but can be an alternative web server for the Embedded PL/SQL Gateway (EPG, using the database's internal XDB HTTP Server) or Oracle HTTP Server (OHS) to host your APEX instance.
    So as ALEX points out, it'll need about as much resources as one of the other web servers would. How much it will be depends on your usage scenario. Again, there is no immediate relation to the database listener.
    -Udo

  • What is a resource in OIM - really?

    I'm trying to understand what I can do with resources, and how they can be manipulated (especially through the API.)
    From the documents, "A resource object is a virtual representation of the target system, and contains all entities related to the external resource." Well, the 2nd part of that sentence seems to be overstating the case - you can create a resource type and create instances of that type, where the type will have user-defined attributes (url, username, etc.)
    But still, it seems that the purpose of a resource object is to represent a system, perhaps for the use of reconciliation, but also so that OIM can provision the resource object to users (or groups.)
    However, some of my coworkers believe that a resource is more than that. In particular, a resource could represent an arbitrary external entity (let's say, a bit absurdly, a particular automobile), and that there should also be ways to associate operations/permissions with that entity (in this case, "own", "drive", "ride-in", "fix", "sell"), and each operation/permission can be assigned to a user (or group.)
    I find no evidence of this type of fine-grained permission-oriented use of resources. Is there a way to handle this type of problem within OIM (9.0.3)? If so, how? Is there something more appropriate than resources?
    If it is possible to have operations defined on resources, how would you grant a user a subset of the operations?
    And a related question: the API provides what seems to be read-only access to Objects? Is it possible to create Objects through the API? And what is the relationship of Objects to ITResources?
    Many thanks for your thoughts and responses!

    An IT Resource Type Definition is a type of resource, whether its a database, unix server, Active Directory Domain, Exchange Server, and such.
    An IT Resource is a specific instance of a Type, which contains all the connection specific parameters that are passed onto the API calls. If you look at any of the APIs for active directory, it maps the values from the IT Resource to the connection parameters so it can create the connection to Active Directory.
    In your example of the automobile, lets say you find a java api, or create one to communicate with an automobile. You have a Type Definition called Automobile, and an IT Resource of specific automobile type, with all the connection parameters you will require when you run your APIs. You would also require a resource object of Automobile type, a process form for the main account, a child table for the permissions, or check boxes, whichever way you would want to select the access rights, and a provisioning process.
    So when a request is made for the automobile, the request would specify which specific instance on an IT Resource Lookup field, and however you have defined the access rights, they would select them. When the request is finalized, and provisioning, your APIs would use the IT Resource parameters to establish a connection, and then values from the process form to create the account with the specific rights defined on the form. Then close the connection.
    You could also create a generic resource object, that requires no it resource, and it would simply be a place holder for a physical object like a secure id token, or mobile phone. You could just have a provisioning task that requires manual interaction for someone to go in and actually mark the object as "Sent Out" or completed.
    Currently you cannot create an object through an API. They are only available during the Import, or creating with the design console.
    -Kevin

  • What is .cs resource in HA resource column from crsstat?

    Hi,
    I wonder whats that .cs type resource on my 10.2.0.3 RAC
    ora.whpcd.SERV1.cs                               ONLINE     ONLINE on node2
    ora.whpcd.SERV1.dwhp1.srv                        ONLINE     ONLINE on node1I think .srv is actuall service and its on node1 , but why .cs resource for that service is on node2 ?
    Please clarify ?
    Regards
    GregG

    It's a database service. you can start and stop as:
    $ srvctl start service -d whpcd -s SERV1
    $ srvctl stop service -d whpcd -s SERV1
    You can define no# of services to the database and assign nodes...etc
    More on services:
    http://download.oracle.com/docs/cd/B28359_01/rac.111/b28252/configwlm.htm

  • What is the resource control corresponding to each kernel parameter

    Hi
    I am trying to prepare (i.e. tune) a Solaris 10 instance for an Oracle 10g install using a Solaris 10 project.
    I am new to using Solaris 10 project resource controls so I might get some of this totally wrong.
    I know all of the "old" kernel parameter names: what each represents and its' required value and I know some of the corresponding resource controls but not all of them.
    That is I do not know the resource control corresponding to each and all of the kernel parameters.
    e.g. I know:
    semsys:seminfo_semmsl == process.max-sem-nsems == The maximum number of sempahores that can be in one semaphore set
    shmsys:shminfo_shmmax == project.max-shm-memory == The maximum size(in bytes) of a single shared memory segment
    shmsys:shminfo_shmmni == project.max-shm-ids == The number of shared memory identifiers
    But I do not know, for example, what resource control corresponds to:
    semsys:seminfo_semmns == The number of semaphores in the system
    Is there a list somewhere of the resource control corresponding to each of the kernel parameters ?
    I know I can set some kernel parameters in /etc/system but that should only be used for system - wide kernel parameters, right ?
    I know there are project, process, task and zone classes of resource controls.
    Can a resource control of any and all of these types be set in a project ?
    Are zone resource controls equivalent to system-wide resource controls ?
    Are there corresponding resource controls to all kernel parameters e.g. such as noexec_user_stack ?
    I have set noexec_user_stack in /etc/system.
    And finally - just to be sure - using a project makes the resource control values permanent, right ?
    Thanks
    Brett.

    Hi;
    Please check below which could be helpful for your issue:
    Kernel setup for Solaris 10 using project files [ID 429191.1]
    Regard
    Helios

  • What is Setting Resource Manager plan SCHEDULER[]:DEFAULT_MAINTENANCE_PLAN

    "Setting Resource Manager plan SCHEDULER[]:DEFAULT_MAINTENANCE_PLAN "
    1. I would like to know what is this.
    2. How to disable this message from alert ?
    Please provide your comments or doc for this subject.
    Thanks,

    References:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/dbrm005.htm
    http://www.dba-oracle.com/job_scheduling/resource_manager_plan.htm
    http://oradbpedia.com/wiki/Oracle_11g_Resource_Manager_Changes
    Regards,
    Venki

  • What is the resource download URL in the exported books.xml file?

    What is the purpose of the resource download URL in the exported books.xml file? The following is an excerpt of a books.xml file.
      <resourceItemInfo>
        <resource>urn:uuid:309dffc8-7993-4837-b8e9-00easde241cfa</resource>
        <resourceItem>1</resourceItem>
        <metadata>
          <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">Paradise Lost</dc:title>
          <dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Milton</dc:creator>
          <dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">application/epub+zip</dc:format>
          <dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Project Gutenberg</dc:publisher>
          <dc:language xmlns:dc="http://purl.org/dc/elements/1.1/">en</dc:language>
          <dc:identifier xmlns:dc="http://purl.org/dc/elements/1.1/">http://www.gutenberg.org/ebooks/26</dc:identifier>
        </metadata>
        <src>http://xxxxx.com/books/309dffc8-7993-4837-b8e9-00e97e1cfa.epub</src>
        <downloadType>simple</downloadType>
        <licenseToken>
          <resource>urn:uuid:309dffc8-7993-4837-b8e9-00e97e241cfa</resource>
          <permissions>
            <display/>
            <excerpt/>
            <print/>
          </permissions>
        </licenseToken>
      </resourceItemInfo>

    No real purpose.

  • What is iTunesMiniplayer.Resources

    ITunesMiniplayer.Resources is the error message I get when I try to download the latest version of iTunes.  I have already uninstalled iTunes from my PC.  The download appears to be working fine but then it stops and gives me this message and when I click Finish it ends the download.

    Hi James1940,
    The article linked below details a number of troubleshooting steps that can help get iTunes successfully updated.
    If you can't install or update iTunes for Windows
    https://support.apple.com/en-us/HT201668
    Regards,
    Allen

  • Just curious (about whats in the resource page)

    Why is Lion server advance admin guide show up in the osx server resource page instead of that of osx server's?

    Hi there Dayzperr, 
    Welcome to the forum! It can be a bit disconcerting when you continuously see your estimated arrival date change for a store pickup order, so I'm glad you've reached out to us to find out a bit more. 
    With the information you registered with the forum, I was easily able to locate your order. It appears that your PC order is being fulfilled by a vendor, which may take longer than originally anticipated. It appears the vendor has acknowledged the order, and is processing it on their end. I am truly sorry if this causes you any disappointment or frustration as I know you were hoping to receive this PC by 7/29/15. 
    If you should have any other questions or concerns, please let me know! 
    Sincerely, 

  • What does it mean: Error Message "Low system resources" ?

    Hi,
    we are using CR out of Visual Studio 2005 and 2008 for a PDF export.
    We are able to start a report process and can see on the load of the process that the report seems to be generated, but we didn't received a report PDF file.
    We add the following Registry key (depending on CR version) to get log files:
    For 10.5: HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Report Application SErver\Server\
    For 10.2: HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\Report Application SErver\Server\
    and got the following error message:
    ErrorLog 2010  3  1 23:55:15.293 5576 7304 (..\reporthandler.cpp:11256): CReportHandler::buildReportViewerError: CSResultException thrown.   ErrorSrc:"CRPE" FileName:"..\reporthandler.cpp" LineNum:11252 ErrorCode:568 ErrorMsg:"There are not enough free System Resources to perform this operation.
    Error formatting Field Object.
    Failed to export the report.
    Error in File e:\ReportTemp\serviceusage {8F9A2AEB-96BB-400F-AB88-47E09C916B67}.rpt:
    Low system resources.."
    ErrorLog 2010  3  1 23:55:15.293 5576 7304 (..\reporthandler.cpp:11256): CReportHandler::buildReportViewerError: CSResultException thrown.   ErrorSrc:"CRPE" FileName:"..\reporthandler.cpp" LineNum:11252 ErrorCode:568 ErrorMsg:"There are not enough free System Resources to perform this operation.
    Error formatting Field Object.
    Failed to export the report.
    Error in File e:\ReportTemp\serviceusage {8F9A2AEB-96BB-400F-AB88-47E09C916B67}.rpt:
    Low system resources.."
    Maybe do you have any suggestions what the problem could be? What does it mean with "Low system ressources"? There should be enough memory, hard disc size and cpu power on the machine.
    Please let me know if you need any further information.
    Thank you very much for your help in advance!!
    Best regards,
    Matthias

    Re logging. What I was referring was the following in  your post:
    We add the following Registry key (depending on CR version) to get log files:
    ErrorLog 2010 3 1 23:55:15.293 5576 7304 (..\reporthandler.cpp:11256): CReportHandler::buildReportViewerError: CSResultException thrown. ErrorSrc:"CRPE" FileName:"..\reporthandler.cpp"; LineNum:11252 ErrorCode:568 ErrorMsg:"There are not enough free System Resources to perform this operation.
    Error formatting Field Object.
    Failed to export the report.
    Error in File e:\ReportTemp\serviceusage {8F9A2AEB-96BB-400F-AB88-47E09C916B67}.rpt:
    Low system resources.."
    ErrorLog 2010 3 1 23:55:15.293 5576 7304 (..\reporthandler.cpp:11256): CReportHandler::buildReportViewerError: CSResultException thrown. ErrorSrc:"CRPE" FileName:"..\reporthandler.cpp"; LineNum:11252 ErrorCode:568 ErrorMsg:"There are not enough free System Resources to perform this operation.
    Error formatting Field Object.
    Failed to export the report
    Error in File e:\ReportTemp\serviceusage {8F9A2AEB-96BB-400F-AB88-47E09C916B67}.rpt:
    Low system resources..".
    I think we want to back up a bit here. I am not sure what  "Low System Resources" means or what it's about. So, let's try the following:
    1) Are you able to export to any other format?
    2) Are you able to print to printer?
    3) Try a new simple app and add a viewer to the form. See if export from the viewer export button works.
    4) In the above new app, export to CR report format from the export button on the viewer toolbar.
    5) If you are able to get an exported rpt file, it will have saved data with it. Run that report in your original app (comment out any db logon code). Can you export a saved data report?
    6) Make sure you have read / write permissions on the win\temp directory
    7) What database are you connecting to and what is the database connection method (OLE DB, ODBC, etc.)
    Ludek

  • Problem in locating resource in the package

    I have a .ear package like following:
    test.ear
    |____________META-INF/application.xml
    |____________APP-INF/lib/test.jar
    |____________ APP-INF/lib/testrar.rar (A Resource Adapter, contains a testrar.jar
    in .rar package)
    The URL returned by calling Class::getResource("myTestData") from a class under
    testrar.jar does not give the right URL (file name and path are missing). The
    URL is like: zip:./myserver/stage/_appsdir_activityNode_ear/APP-INF/lib/testrar.rar!/testrar.jar
    Is this a bug in weblogic server V7.0 or is there anything wrong? I got to put
    the .rar file under APP-INF because the test.jar needs to reference some classes
    in it.
    Thanks for any suggestions.

    Hi duffymo, thanks for your comment.
    It works if I put the properties file in the
    WEB-INF\classes directory.
    But, if I put the properties file in the
    WEB-INF\classes\resources directory, it does not work.
    I really want to put those properties in a folder. Is
    there any way to do it?Yes, Natalie, change the String you pass to the getResourceAsStream to include the resources path:
    String search = "resources/yourFile.properties";I believe the class loader will look in the CLASSPATH for that file along that path.
    I've done this by adding an <init-param> to my <servlet> in web.xml:
            <init-param>
                <param-name>init-config</param-name>
                <param-value>/WEB-INF/config/api-prototype-config.xml</param-value>
            </init-param>In the servlet init() method I have:
        public void init(ServletConfig config) throws ServletException
            super.init(config);
            ServletContext servletContext = this.getServletContext();
            try
                String configXmlName    = this.getInitParameter(APIPrototypeServlet.INIT_XML_PARAM);
                InputStream initStream  = servletContext.getResourceAsStream(configXmlName);
                if (initStream == null)
                    throw new FileNotFoundException("Could not find config: " + configXmlName);
    // more following code - the stuff above is what's important.This is working for me.

  • JDBC connections using resource file

    I have heard that a resource file can be used to
    assign an URL and DB2 driver to establish a connection.
    What is a resource file and how can this be done?
    We have several URL and DB2 drivers to assign depending on what server we are processing on.
    thanks

    Hi,
    here's a sample:
    try {
    Properties properties = new Properties();
    properties.load(instance.getClass().getResourceAsStream("/sqlhandler.properties"));
    String driver = properties.getProperty("jdbc.driver");
    String url = properties.getProperty("jdbc.url");
    String login = properties.getProperty("jdbc.login");
    String password = properties.getProperty("jdbc.password");
    Class.forName(driver);
    connection = DriverManager.getConnection(url,login,password);
    The resource I use is a properties file that is (in this instance) located in the same place as class file. You can fully qualify the location of the resource if you wish.
    Hope this helps
    cheers
    Dave

  • Can I Use a XML file as Managed Resource?

    Hi,
    I have a XML file which has all employee details.
    Can I use that XML file as a Resource in IDM?
    If so please let me know the steps to do.
    Please help me in this regard.
    Thanks
    RMS

    No.
    Since the XML file you have has custom tags, there is not a way for IDM to understand it's contents.
    IDM does offer a "Simulated" resource, which is an XML based resource, but it has a defined structure. You might be able to alter your XML to match what the Simulated Resource expects, or better yet, get it into a database and use the database table adapter.

Maybe you are looking for

  • Green Screen (Built in Isight)

    Whenever I open a application with isight the screen is just green.

  • Change Control tools for APEX development

    I have a customer who is using APEX and would like to have change control, version, and synchronization of APEX pages... Basically we are talking about Configuration management capabilities

  • Can't get rid of original Audio

    I'm overwriting a clip on the timeline with a clip from the events, but I can't get rid of the audio from the timeline clip. What's up? Even when I cut the clip I want to replace, its audio remains.

  • 3 System Landscape for NW2004s BI?

    Hi All, Given the scope of BI systems in NW2004s BI, what is the recommendation regarding 2 vs. 3 system landscape for BI? With BW, it was (relatively) easy to maintain a Dev, QA and Production system. Now with Portal and Java components of BI, the h

  • Help needed at OSX problems on my iMac

    Hi I tried to install Boot Camp and Win XP on my iMac, but something went wrong. Now I cant find the partition with both operation systems on.... Then I tried the OSX installation program by using install disc 1, but the setup program wont find the p