Results 1 to 4 of 4
  1. #1
    The Vip is offline Member
    Join Date
    Jul 2016
    Posts
    3
    Rep Power
    0

    Cool How to extract resources from a file?

    I've a file with NO extension and i know that inside it there are some Images, Audios and Text files. How can i extract or view those items with java?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: How to extract resources from a file?

    How are those things stored in this file?
    That would be the first step.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,983
    Rep Power
    8

    Default Re: How to extract resources from a file?

    Short answer: you don't, unless it's a zip file.

    Long answer: You'd have to know what file you're dealing with. If you don't have an extension, your next best bet is to find magic numbers (https://en.wikipedia.org/wiki/Magic_...mbers_in_files). After you have identified the file you are working with, you need to know how to read and interpret the bytes you're getting. Either find a library that does that for you, and if that doesn't exist, write your own file handling library. Find the specifications for that specific file format, and write a Reader that knows how to deal with all the bytes in the file. Sounds like a fun project :)
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  4. #4
    The Vip is offline Member
    Join Date
    Jul 2016
    Posts
    3
    Rep Power
    0

    Default Re: How to extract resources from a file?

    Thanks very much @Tolls @SurfMan

Similar Threads

  1. executeable jar file, with external resources
    By dark_maven in forum Apache Maven
    Replies: 0
    Last Post: 05-17-2013, 04:18 PM
  2. How to insert resources into jar file
    By luis.depedro in forum New To Java
    Replies: 1
    Last Post: 01-28-2012, 06:42 PM
  3. adding resources to jar file
    By Mekonom in forum New To Java
    Replies: 3
    Last Post: 02-21-2010, 11:34 PM
  4. Access to resources inside jar file
    By aleks.farrier in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 04-15-2009, 01:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •