Can somebody explain relative files, URLS, path

Hello,
I'm confused about "where" my files are located in relation to the program. I have the program in package com.buchuki.buchuki. The directory structure is /home/dusty/Documents/code/java/buchuki/com/buchuki/buchuki
I run the program from /home/dusty/Documents/code/java/buchuki with the command java com.buchuki.buchuki.Buchuki
The program runs fine.
But now I want to put a directory SOMEWHERE called images, that contains (you guessed it) images. Then I want to know how to access it from within my program. I will eventually want to put the program in a jar archive.
Do I put the images in /home/dusty/Documents/code/java/buchuki/com/buchuki/buchuki/images and if so, how do I access it as a file (for example, an URL that I can pass to ImageIcon). Or do I put them in /home/dusty/Documents/code/java/buchuki and if so, how do I access it as a file?
It's a simple question, but I'm really stumped!
Thanks,
Dusty

Another way to accomplish this (independent of the CLASSPATH) is to assume that your application has some given directory hierarchy and define an 'application home' environement variable on the command line:
java -Dbuchuki.home=/home/dusty/Documents/code/java/buchuki [name of main class]
then, in your main class, have a static String variable BUCHUKI_HOME that you assign like so:
BUCHUKI_HOME = System.getProperty( "buchuki.home" );
Now you can build relative file paths from BUCHUKI_HOME (don't forget to use File.separatorChar) to your images/ directory.
This is just another way of doing things...the previously suggested approach is an excellent one.

Similar Messages

  • Can somebody explain relation between BAM and TrackingHost

    In My application I have used BAM API to track some business data.
    Is it mandatory to have at lease one tracking host is running to move data between BizTalk Message box database to BAM primary import database?
    Thanks
    Ammu.

    Is it mandatory to have at lease one tracking host is running to move data between BizTalk Message box database to BAM primary import database?--> Yes. There should be at least one tracking host (a BizTalk host which has tracking enabled) to move data
    from message box to BAM Primary Import.
    Check below link
    https://msdn.microsoft.com/en-us/library/cc296633(v=bts.10).aspx
    Hope this helps
    Greetings,HTH
    Naushad Alam
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or
    Mark As Answer
    alamnaushad.wordpress.com

  • Can somebody explain to me how java and xml are related?

    Hi guys
    im new to java and xml.Been reading a lot regarding java and don't seem to have a problem with it...
    the problem is the xml part...im doing a simple GUI project using swing(online store) and i have to convert it to xml
    I have absolutely NO IDEA why i must convert my java to xml and have no idea how to do that.I been reading on the net that xml is a exten~ markup language and it is better and useful.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?
    2)why do ppl want to convert java to xml when they can just stick to java
    3)what is actually xml...
    4)Do i need a program to create xml like i need jcreater to create java application
    5)How do we actually convert?is there any links that you guys could tell me?
    thank you
    tomleo

    im new to java and xml.Been reading a lot regarding
    java and don't seem to have a problem with it...Okay.
    the problem is the xml part...im doing a simple GUI
    project using swing(online store) and i have to
    o convert it to xmlYou have to? So presumably somebody in a position of authority told you that?
    I have absolutely NO IDEA why i must convert my java
    to xml and have no idea how to do that.I been reading
    on the net that xml is a exten~ markup language and
    it is better and useful.I have no idea either (besides which, it doesn't make sense). But why ask us? Somebody told you to do that, ask them why.
    Sure, XML is useful. But it isn't a programming language so it can't be used as a substitute for Java.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?They aren't related, except perhaps in that they are both used in computers.
    2)why do ppl want to convert java to xml when they
    can just stick to javaThey don't.
    3)what is actually xml...Start here for numerous definitions:
    http://www.google.ca/search?hl=en&lr=&oi=defmore&q=define:XML
    4)Do i need a program to create xml like i need
    jcreater to create java applicationNo, XML is just text. But then Java code is just text too.
    5)How do we actually convert?is there any links that
    you guys could tell me?You don't convert Java to XML. My guess is that because you don't know much about Java or XML, you have misinterpreted something that somebody told you.

  • Can somebody explain how dunning & hold are linked toghter

    In the IMG, i can not find out How dunning are linked with academic hold in the student file and can somebody explain how dunning is linked with academic hold.
    I defined hold type in IMG but i can not find out how to link with hold type with dunnng ?.
    regards,
    jin dal

    Dear Song,
    Answers to your queries are given below:
    Sample function module:
    u2022 Is only used as a template for creating the standard function modules to be carried out
    u2022 Defines the interface that is binding for the standard function modules
    u2022 Describes in its documentation what the underlying event can be used for
    Standard function module:
    Name of application-specific standard function module that can be carried out at a given time.
    The standard function module interface corresponds to the sample function module, which it must match exactly.
    Active function module:
    Function module which is to be called for the specified event.
    If you don't want to take printout then use Functional module 340 as Event 0340 is called when all data is read for a dunning notice.
    You can use standard function module FMCA_DUNNING_READ_ITEMS_0340 for this purpose.
    Hope it will solve your query.
    Warm Regards
    Vinod Kumar

  • Can somebody explain how ABC analysis is done ?

    Hi Experts,
                         Can somebody explain how ABC analysis is done . If I use MC40 transaction there I have 4option but I can use either one of those . For second option , Usage value as number we can directly specify cost and accordingly system will classify materials In A, B and C category .
    I have question on 1st 3 rd and 4 th option . How system will classify materials if These option is used .
    Please explain with examples .
    Points will be rewarded .
    Thanks in advance !
    Neal

    Hi Sir ,
                     Thanks again , I would explain what I have understood .
    MC 40 . Option selected is Usage value with value put are 70 , 20 , and 10 .
    Suppose I have 3 mat in plant
                  Stock         Value
    1) X        100 kg      1000   ( for 1 kg from MM)
    2) Y          20 PC      2300 
    3) Z          30  lt      40000
    Now how would system classify these items ? Will it consider price or only consumption /qty ? or both ?
    Please explain with the same figures . Again the 90 days period you said , is it taken automatically ? because on this T code there is no option for entering time period .
    Neal

  • Can somebody explain what the Radix number is in Character

    I am looking for a good way of converting numbers to characters and I was reading up on the Character API, and they are using this term Radix, and I don't understand what that is all about. Can somebody explain what the radix is for?

    Wait a second I tried this code out and this is the output
    System.err.println(Character.digit('a', 10));and i get a -1, which means "not a valid digit in the specified radix.
    Then I tried other combinations like
    System.err.println(Character.digit('a', 11));
    System.err.println(Character.digit('b', 12));
    System.err.println(Character.digit('c', 13));and they all work, and but with only those sequential characters and numbers. So right now I am very confused as to what this radix, or this function serves. Can somebody explain?

  • Can somebody explain to me how I can detect that an internet connection exists (VB)?

    Can somebody explain to me how I can detect that an internet connection exists (VB)?
    Peter Goossens

    There is no reliable way. Better test whether you can go to where you want to go. And be prepared to support proxies, even the complex ones that require authentication. 
    System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable reports your local connectivity regardless of whether one of your connected networks has Internet access.
    Microsoft's Network Awareness API (the one used in control panel\network and sharing center) use a connection test to a web site setup by Microsoft. But your customers could be behind cooperative firewalls that make this test unusable even when Internet
    access is available though other means (e.g. via a local proxy server). If you want to connect to your own web site, then you can skip that and just connect to your web site instead. Even if you were able to connect to Microsoft's web site there is no guarantee
    your web site would be accessible in the same network.
    Visual C++ MVP

  • Can somebody explain this store procedure

    Hi there
    can somebody explain me this Oracle store procedure, I am not able to figure it out anything from this SP :(
    CREATE OR REPLACE PROCEDURE MyDummySchema.MyDummyStoreProcedure
    (a_created_by_proc SomethingDummy.CREATED_BY_PROC%TYPE)
    as
    BEGIN
    /* Set up your global variables */
    XYZ_FORMAT.g_s_created_by_proc := a_created_by_proc;
    XYZ_FORMAT.g_d_current_time := sysdate;
    XYZ_GENERATEEODQUEUE.XYZ_GENERATEQUEUE;
    XYZ_PROCESSQUEUE.XYZ_PROCESSTRADES;
    XYZ_SYNC_SOMETHING(a_created_by_proc);
    END MyDummyStoreProcedure;

    Here
    XYZ_FORMAT, XYZ_GENERATEEODQUEUE, XYZ_PROCESSQUEUE
    are package names;
    XYZ_SYNC_SOMETHING is another PL/SQL procedure name; the procedure takes one parameter;
    XYZ_FORMAT.g_s_created_by_proc, XYZ_FORMAT.g_d_current_time are global variables defined in the package XYZ_FORMAT, in package definition part of it;
    XYZ_GENERATEEODQUEUE.XYZ_GENERATEQUEUE,
    XYZ_PROCESSQUEUE.XYZ_PROCESSTRADES are stored procedures w/o parameters definned in packages XYZ_GENERATEEODQUEUE and XYZ_PROCESSQUEUE respectively.
    But only the author [hopefully] knows what is the point of all this stuff :)

  • ESCAPE Option can somebody explain it ?

    ESCAPE Option can somebody explain it ?
    Thanks in anticipation
    SDG

    In first SELECT the underscore is intrepreted as any one single character. What if we wanted to search for an underscore specifically. The second example allows us to search specifically for underscore character with LIKE.
    SQL> select table_name from dba_tables where table_name like 'DBMS_%' ;
    TABLE_NAME
    DBMS_ALERT_INFO
    DBMS_LOCK_ALLOCATED
    DBMSALERTINFO
    3 rows selected.
    SQL> select table_name from dba_tables where table_name like 'DBMS\_%' ESCAPE '\' ;
    TABLE_NAME
    DBMS_ALERT_INFO
    DBMS_LOCK_ALLOCATED
    2 rows selected.
    SQL>Sorry Nicolas, your post was not visible at that time.
    Message was edited by:
    Kamal Kishore

  • I bought a bluetooth earpiece to be used with my ipad. But my ipad could not detect the earpiece. My friend's other tablet was able to detect my earpiece. Can somebody explain to me why my ipad could not detect my earpiece.

    I bought a bluetooth earpiece for my ipad but my ipad could not detect the earpiece. Can somebody explain why that is so? I used the piece on my friend's tablet and it could detect the earpiece meaning that it is working. Why my ipad could'n? I want to use it to listen to music or video. I could use the normal wire type earpiece but it is very cumbersome.

    I bought a bluetooth earpiece for my ipad but my ipad could not detect the earpiece. Can somebody explain why that is so? I used the piece on my friend's tablet and it could detect the earpiece meaning that it is working. Why my ipad could'n? I want to use it to listen to music or video. I could use the normal wire type earpiece but it is very cumbersome.

  • Can a single PDF file url be shared on facebook or website?

    Can a single PDF file url be shared on facebook or website?

    Hi sday706,
    Sure thing! If you share your file via Acrobat.com or Adobe Send, you can generate a URL for that file by choosing Create Anonymous Link after you've selected the file that you want to share.
    Best,
    Sara

  • Can somebody explain what is LUW ?

    Hi Gurus,
    can somebosy explain me what is LUW(Logical unit of work).
    I went through some book, but i am not able to get the concept.
    can somebody help me out inthis
    Thanks & regards
    Rajesh Meda

    hello Rajesh,
    Did you go this through this:
    http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm
    Check this out.
    Anyways as you know in SAP the user acting a presentation level tries to read/write data from database using SAP application layer. This entire activity consists of several dialog steps (small activities if you may) and is termed as a LUW. So an SAP LUW consists of several dialog steps which are dependent on each other. Only if all are completed is a LUW executed successfully and in case of any failures entire thing is roll backed and terminated.
    Regards.
    Ruchit.

  • Can somebody explain (connection time)

    Because of broadband problems, I've been keeping intermittent track of my connection times and IP profile.
    Best way is to show you...the first set was 2 days ago at lunchtime.
    11/8/11
    @12:00 noon
    Downstream
    1,408 Kbps
    Upstream
    448 Kbps
    Connection time
    0 days, 7:58:42
    Download speed achieved during the test was - 949 Kbps
     For your connection, the acceptable range of speeds is 200-1000 Kbps.
     Additional Information:
     Your DSL Connection Rate :1408 Kbps(DOWN-STREAM), 448 Kbps(UP-STREAM)
     IP Profile for your line is - 1000 Kbps
    Here's tonight's...
    Download speed achieved during the test was - 683 Kbps
     For your connection, the acceptable range of speeds is 200-1000 Kbps.
     Additional Information:
     Your DSL Connection Rate :1088 Kbps(DOWN-STREAM), 448 Kbps(UP-STREAM)
     IP Profile for your line is - 750 Kbps
    Downstream
    1,088 Kbps
    Upstream
    448 Kbps
    Connection time
    48 days, 5:46:02
    (My bold and red)
    So - can somebody please explain what's going on?
    I have enough trouble understanding why the dratted connection keeps dropping for no apparent reason and at seemingly random intervals.  But this...is....mind boggling.  How can I possibly have been connected for 0 days - and then 2 days later be connected (on the same computer) for 48 days?  I won't bother asking why I only have 750 for a freakin' profile, I know that's likely down to my very unstable connection.  Something I will get back to attempting to sort out when the kids go back to school.  But - if this kind of thing means my modem is on the way out - it's the kind of thing it would be nice to know before I start drilling holes in the wall and buying shielded cable.
    HELP?
    (Oh, and what's with the box jumping up and down while I'm typing this? Or is that because the husband's wifi-ing something now...geez!)
    **Here today....blonde tomorrow**

    fragment_sweep
    0
    zero-length_fragment_size
    0
    small_fragment_size
    0
    fragment_size_overrun
    0
    fragment_overlap
    0
    fragment_out-of-order
    0
    ip_protocol_scan
    0
    tcp_port_scan
    0
    tcp_syn_scan
    0
    stealth_tcp_null_scan
    0
    stealth_tcp_fin_scan
    0
    stealth_tcp_xmas_scan
    0
    stealth_tcp_full_xmas_scan
    0
    stealth_tcp_vecna_scan
    0
    stealth_tcp_syn-fin_scan
    0
    udp_port_scan
    0
    ping_sweep_scan
    0
    tcp_syn_flood
    2
    udp_flood
    0
    ping_flood
    0
    icmp_unreachable_storm
    0
    smurf_broadcast_attack
    0
    smurf_storm_attack
    0
    fraggle_broadcast_attack
    0
    fraggle_storm_attack
    0
    land_attack
    0
    tcp_null_port
    0
    tcp_data_on_syn_segment
    14
    tcp_invalid_urgent_offset
    0
    udp_null_port
    22
    icmp_type_unknown
    0
    icmp_code_unknown
    0
    ip_zero_payload
    0
    tcp_rate_limiting
    0
    udp_rate_limiting
    0
    icmp_rate_limiting
    0
    ip_rate_limiting
    0
    Oh, and while I'm asking stupid questions, I found this.
    huh?  I live very nearly out in the middle of nowhere.  Intrusions?  What - do sheep or passing birds have wi-fi now?  Or is it just protecting my home network from the cars passing by on the 66 at 70+ mph?  You know, just asking out of curiosity (and a strong desire to put off doing more housework...lol).
    **Here today....blonde tomorrow**

  • Firefox will not show links to flv files. I get the error message for each flv file: "File not found. Firefox can't find the file at (path) .flv." Any mov and swf files in this same path will show. I can see the videos in Safari so the paths are correct.

    Firefox will not show links to flv files. I get the error message for each flv file: "File not found. Firefox can't find the file at http:// (path) .flv." Any mov and swf files in this same path will show. I can see the videos in Safari so the paths are correct.

    Is this a webpage that contains a link to a flv file? Please post a link to the page and tell us which link(s) are the problem flv files or else post a link to the .flv file itself.
    Alternately, click on one of the sample FLV File links on this page and tell us exactly what happens:
    http://www.mediacollege.com/adobe/flash/video/tutorial/example-flv.html
    It might also help if you post the exact error message, including the path to the flv file.
    '''Note:'''
    Depending on how you have Firefox set up, clicking on a FLV File link will either save the FLV file to your computer or Firefox may open it automatically in an external application right after downloading (Firefox may ask you first). Firefox itself can't play FLV files so you need a "helper" application (or a plugin for flv files, if ther is one. You can see if Firefox is already set up to download or open FLV files by going to Firefox Preferences and looking in the Applications list. Find the FLV file type in the list and, if the action is "Open with", it should show the application that can play FLV files (e.g., VLC Media Player or Perian). See [[Managing filetypes]] for more information.

  • Where can i use the file:// url

    i am new to DTV and here is a very basic doubt abt file:// url.
    Under what all situations can we use a file://
    i had seen at many places that restrictions can be there depending upon whether the file is local or in the broadcast file system.

    Don't use the "file://" URL.
    If you want to address files which are part of an application, either address them by opening a file or via a resource. For example, a file called "example.xml" in the base directory of an application can be accessed by either
    a) new FileInputStream("example.xml")
    b) put the directory containing the file in the application's classpath and then access the file by Class.getResource("example.xml")

Maybe you are looking for

  • My mac's run out of memory and I can't find the culprit!

    Hi, I'm in serious need of some help! I'm sure this is simple, but I'm about to break down over it – I use my mac for everything. I've got a 200gb 2009 macbook (running iOS7), and it's told me it's run out of memory. The storage tab in 'about this ma

  • Paid $60 - for a phone number rather than a subscription? Please chime in and help a newbie

    Hi, first a quick rant: I'm an EXTREMELY frustrated new user. I have spent the last hour trying to figure out what I just purchased and what I can do to get an explaination, but whoever created this website did so without a new user in mind. Quickly:

  • Issues restoring images

    Is anyone else having a error when trying to restore from a image in disk utility? I get a error that the source image needs to be imagescanned before proceeding.

  • TS1717 why is itunes freezing on 2 different laptops , no matter what version I try downloading ?

    Why has itunes caused 2 laptops to freeze - what has Apple done to what was a working system ? I can no longer search without the system freezing !!! That applies to 2 versions I have used  - itunes was working fine until I installed the new version

  • Mac Mini Won´t Burn CD´s

    I have an old G4 PPC Mac Mini running Mac OS X 10.3, and whenever I try to burn a CD, it starts to write it then says something like ´An error has occured´. It does this no matter what type of content is being burned. How can I fix this problem.