Accessing a file through FileReader

I've to give the full path while accessing the file using the following code. Is there any alternative where i can provide the relative path and still get the desired result?
BufferedReader in = new BufferedReader (new FileReader ("/apps/secDBadmin/classes/database.cfg"));
I'm accessing the file database.cfg from a class which is inside the same folder (/apps/secDBadmin/classes).

Did you try ClassLoader.getResourceAsStream(String)
For your case the code will look something like,
Class c = Class.forName(YouClassName);
or
Class c = this.getClass();
InputStream in = c.getClassLoader().getResourceAsStream("JustTheFileName");
BufferedReader rd = new BufferedReader(new InputStreamReader(in));

Similar Messages

  • Installed PSE 8 and am now unable to access RAW files through Camera Raw.

    Help! I have installed PSE 8 and
    now cannot access Raw files through Camera Raw click
    on Editor and the photographs open in Editor.
    I have tried installing the upda
    te 8bi in the plug-in and there was already a plug-in there.
    PSE6 worked fine on this system. Any help appreciated.

    Firstly thanks to the people who
    offered help. This is what I did and somehow the problem is solved. I installed PSE 8 on my old machine with XP and an old Xerox monitor and it worked OK. I uninstalled PSE 8 from the newer machine on Vista. Made sure all the adobe files for pug-ins had gone then reinstalled. I then tested the screen resolution of my monitor a HP w1907v, smaller resolutions made no difference but opening it up to max did. When I wish to open a RAW file click open click the photograph and in the bottom file format box make sure you are asking for RAW files to be opened and 'bingo'. This upgrade for PSE 8 has the latest CameraRaw on it but the problem was there from the first installation so perhaps it is a combination of screen resolution and making sure the file format for opening is specified. So after hours of effort a satisfactory outcome. I probably confused the issue by installing the plug-in when there was no need. PSE 8 will last me a long time!!!

  • Can't access jpeg files through finder after import to iPhoto '11

    Am I missing something here? I recently imported my entire library from a backup source to iPhoto '11 on a new computer. I used to be able to browse the folders in the iPhoto library in a finder window. Now when I try to open the iPhoto library, the application itself launches.

    Since iPhoto 7 (iLife 08) the old iPhoto Library Folder is now a Package File. This is simply a folder that looks like a file in the Finder. The change was made to the format of the iPhoto library because many users were inadvertently corrupting their library by browsing through it with other software or making changes in it themselves.
    Accessing files via the Finder has never been supported on any version of iPhoto.
    There are many, many ways to access your files in iPhoto:
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    *_(Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)_*
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    If you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage/Outlook, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: File -> Reveal In Finder on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Note that iPhoto sends a copy+ of the file to Photoshop, so when you save be sure to use the Save command, not Save As... If you use Save As then you're creating a new file and iPhoto has no way of knowing about this new file. iPhoto is preserving your original anyway.
    All of the above are a: Faster and b: Safer than rooting around in the old Library folders.
    Regards
    TD

  • Opening windows "Access" database files through network

    Is there any way to open windows "Access" database files on my mac through a network to a windows machine? I have the windows for mac software but it doesn't include access.

    Hi,
    As per the description, I understand that your Office 2013 cannot open files through a network share directly.
    I would like to know that how many clients/users are affected by this in your environment. It could be some specific user account settings, that the Office applications are being affected by.
    I'd first suggest you try with a new Windows user profile, then verify result.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How to access remote file through PL/SQL

    I need to access remote operating system files through PL/SQL. I have tried accessing using utl_file package by setting UTL_FILE_DIR parameter to the mapped drive of the remote machine, but when tried to read the file it raises INVALID_OPEARTION exception.
    I have also tried accessing through the directory object also.
    Would appreciate if anyone can suggest for the same.
    Thanking you in anticipation
    Regards,
    Vipul

    Hi,
    A remote file means a file that is on a Shared server resource. This file cannot be accessed by Oracle Unless the that drive has been mapped on the Server and proper permissions are given.
    The file can be accessed by the client if he is using TEXT_IO and the shared drive is mapped to the client.
    Hope this helps ...
    Regards,
    Ganesh R

  • Accessing XML files through java

    Can any one explain me the easiest way of accessing XML files from Java.

    Hi,
    If you want to only access the XML file, use the SAX parser It will be very easy to handle and identify the element and value.
    else if u want to change the XML value also, then better go with DOM, Which has very good flexiblity.
    use according to the need, let me know if any help is required......
    With Cheers
    PrasannA

  • Access is denied while accessing .js file through OHS URL

    I have a strange issue, can somone share your thoughts Please,
    We have deployed deployed the WebCenterPortal application into the server, and it is working fine if we access it through the deployed server url, but,
    we have a http server(Oracle HTTP Server)to protect the deployed applications url, here when iam trying to access the same deployed url using http server url, it is working fine for all the pages but not for some pages , it showing the below error,
    Message: Access is denied.
    Line: 89
    Char: 282
    Code: 0
    URI: http://xxxxx/portl/afr/partition/ie/n/default/opt/core-11.1.1.6.0-1318.js

    Sure Yannick,
    we have Webcenter Portal servers on Linux box, and OHS is on Windows box,
    We are able to access all the pages but some pages its throwing the java script error mentioned above, we have not included any javascript code inside the pages, that core-11.1.1.6.0-1318.js could be a framework javascript file,
    Here is the ohs entry,
    </Location>
    <Location /PortalOne>
    SetHandler weblogic-handler
    WeblogicHost exalogichostname
    WeblogicPort xxxxx
    </Location>
    Please let me if i can give more information about the issue

  • Again question about restricting access to files through URL?

    I found many topics about this, but every time it is some special case.
    I want to ask it simple. How can I restrict access to some files in my application through entering URL in Browser, no matter if I am logged or not.
    For example I have included JSP files with jspf extension. I don't want to access them through url. How can I do this?

    May be it will work, but it seems somehow workaround decision - one half of jsp files in one place and another part in other place.
    Message was edited by:
    cheltsov

  • My finder is not working. It won't relaunch and I can't access any files through it. How can I fix this?

    Also, my battery life is at about 2 hours with only Safari and Google Chrome open. I have a 1-year old 13 inch Macbook Pro. I made a different user and the finder worked on there, but I'd like to make it work on my main account since that has all my files.

    my battery life is at about 2 hours with only Safari and Google Chrome open.
    Apple/About This Mac/More Info/Hardware/Power/Battery Information - copy and paste the information here. Do not include any serial numbers.
    User Tip:  Apple notebook batteries – maintenance and troubleshooting
    /Library/Preferences - trash the Finder.plist file, restart your computer and empty the trash.

  • Am I able to access Numbers file from my iPad in iCloud?

    I work on numbers on my mac at work and was wondering if I'm able to access that file through iCloud on my iPad at home? I don't want to pay $10 for the Numbers app on my iPad if I can't access those files.
    Thanks

    You will be able to access them from the iPad

  • How to play and stop flv files through NetStream in AIR Application

    Hi,
    In a folder I have 'n' number of flv file, which are DRM protected. when the user try to play those files for the first time through my AIR application, it will prompt for username and password and gets the license/voucher from the server and store it in AIR Runtime. so that from the next time onwords it won't prompt for username and password as because it already has license/voucher.
         My problem is assume there are 500 files, such that for each file the user has to enter his credentials[username and password]. which is a stupid thing. I want to avoid this process by implementing this process internally/programetically. By playing/accessing each file through netstream from the folder and setDRMAuthenticationCredentials for that file and stop the stream. Here I am able to play each file but I am failed to stop it. I mean to say I will get the license for all the flv files internally[while loading my AIR application], such that user should not be interrupted for his credentials for each file.He should play as if he is accessing/playing a non-DRM protected file. I will be very thank full if any one help me out in this.
    public function init():void {
          connectStream();
          getLicenseForAllFiles();
          videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, drmAuthenticateEventHandler);
          ppt_videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, ppt_drmAuthenticateEventHandler);
            private function getFilesRecursive(rootFolderPath:String):void {
                //the current folder object
                var currentFolder:File = new File(rootFolderPath);
                //the current folder's file listing
                var files:Array = currentFolder.getDirectoryListing();
                //iterate and put files in the result and process the sub folders recursively
                for (var f = 0; f < files.length; f++) {
                    if (files[f].isDirectory) {
                        if (files[f].name !="." && files[f].name !="..") {
                            //it's a directory
                            getFilesRecursive(files[f].nativePath);
                    } else {
                        //it's a file
                        fileList.push(files[f].nativePath);
                        //Alert.show(""+files[0].nativePath);
                        var fileName:String = files[f].name;
                        if(fileName.indexOf("PPT_")!=-1){
                            ppt_videoStream.play(files[f].nativePath);
                            ppt_videoStream.pause();
                        videoStream.play(files[f].nativePath);
                        videoStream.pause();
                private function connectStream():void {
                    videoConnection = new NetConnection();
                    videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    videoConnection.connect(null);
                    ppt_videoConnection = new NetConnection();
                    ppt_videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_videoConnection.connect(null);
                    videoStream = new NetStream(videoConnection);
                    videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    video.attachNetStream(videoStream);
                    ppt_videoStream = new NetStream(ppt_videoConnection);
                    ppt_videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_video.attachNetStream(ppt_videoStream);
             private function netStatusHandler(event:NetStatusEvent):void {
                switch (event.info.code) {
                    case "NetConnection.Connect.Success":
                        //connectStream();
                        break;
                    case "NetStream.Play.StreamNotFound":
                        trace("Unable to locate video: " + videoURL);
                        break;
                private function drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
                private function ppt_drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    ppt_videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
    Thanks
    Sudheer Puppala

    Hi,
    Please go through following links..this will help you:
    http://lucamezzalira.com/2009/02/28/create-pdf-in-runtime-with-actionscript-3-alivepdf-zin c-or-air-flex-or-flash/
    http://forums.adobe.com/thread/753959
    http://blog.unthinkmedia.com/2008/09/05/exporting-pdfs-in-flex-using-alivepdf/
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • How to access/ recover files?

    My user account is not functioning. Once i open it, the screen just becomes black and even if i turn off the pc and turn it on again, the problem is still there. i can open the account of my brother but i can't access my files through there. is there a way i can recover my files in my user account? i will be waiting for your reply. please... thank you very much! 

    can you tell us which model of lenovo you have and which version of operation system installed?

  • Remote Desktop/Access shared files over PPTP VPN

    Hello,
    I just bought the RV180W so I can connect to my office computer from anywhere as a VPN client. The two things I need to do while I am connected as a VPN client is to be able to access my files on my office desktop and be able to remote desktop to it as well. I have Win7 on all of my computers. Ideally, I would like to do that over PPTP VPN connection but if that is not possible I can try Cisco QuickVPN software.
    I enabled PPTP on my router and created a user account. I was also able to successfully establish the connection remotely. While I was connected as a PPTP VPN client, I was able to access the Internet and my router setup page which is telling me that the connection is good. However, I was not able to either discover my office PC under my network tab in Win7 nor I was able to remote desktop. I keep my office PC on all the time and it never go to sleep. I did not create any connection policy but maybe this is the problem. Please let me know if you know of a solution.
    Thanks!

    Hi David,
    Thank you for the response.
    I was able to access the router configuration using the local IP address (in my case 192.168.1.1). I don't think I would have been able to access it using the public IP address since I have the router remote management feature disabled.
    Now after reading your email, I was finally able to remote desktop and access shared files through a PPTP VPN connection. Here is what I did:
    1- I separted the PPTP VPN IP address range from my DHCP range (in my case, PPTP VPN range is 192.168.1.200 to 210 and my DHCP range is from 192.168.1.100 to 199)
    2- I assigned my office desktop PC that I am trying to remote desktop to a fixed IP address (192.168.1.20)
    3- For remote desktop, I had to type the IP address (192.168.1.20). Typing the PC name (officepc) or searching for was not working.
    4- For shared files, I had to map a network drive as //192.168.1.20/My Pictures for example. I couldn't find my PC when searched for it under Network.
    After doing all that, I was able to do kinda what I wanted. Ideally, I would have liked to avoid using fixed IP addresses and be able to access computers by their name and see them under the Network tab. Is their a way to do this? I noticed that RV220W offers SSL VPN, would that help me?
    I would appreciate it if you could answer my last two questions.
    Thanks!
    Mustafa

  • Unable to access media files on network via wirele...

    Up until a month ago was able to access media files through wireless, Os is wins 7, HomeHub 2. the curious thing is no problem accessing internet wirelessly, Have reconfigured Homegroup network, changed WEP key, channel no,reset connected devises then for a couple of minutes I actually access my media files then nothing , and nothing since. unable to access Hub manager from desktop icon or internet browser now. One thing that might be pertinent is that my father has  just had YouView installed around the time the problem started. Contacted the call centre for help they came back informing me that you cannot share files through a BT Hub ! last resort sent an email . Anyone out there can throw me a line I'd much appreciate it

    Try a factory reset of the homehub by pressing a pin into the recess button on the rear for about 20 seconds. This will put your wireless passkey which is on the homehub label so you will need to either reconnect your devices to the default wireless passkey or change it back to what you had.

  • I have a Mac computer and am trying to use a Photoshop CS4 program, but after accessing my desktop files through Adobe Bridge and clicking twice on any of the pictures to get into Photoshop,  instead of entering photoshop I get an enlarged version of the

    I have a Mac computer and am trying to use a Photoshop CS4 program, but after accessing my desktop files through Adobe Bridge and clicking twice on any of the pictures to get into Photoshop, instead of entering photoshop, I get on the lefthand side an enlarged version of the picture with red, yellow and green buttons on top. Any suggestions on what is wrong, or what can be corrected ?

    And there is the problem. Your pictures are opening up in Mac's own Preview app.
    Do you want all your jpegs to open in Photoshop, or only when you are in Bridge?
    Selecting a program to open a certain file is called: File Type Association.
    You can choose this at the MacOS level or the Bridge level.
    Here's how to do both:
    Either MacOS or Bridge has the wrong app associated with the jpeg. Let's start with MacOS
    Close Bridge and Preview. Select one of your jpegs, and press Cmd i, That will bring up the file info window.
    Go down to the "Open with" section of File Info.
    Choose Photoshop CS4 and click on the Change All... button to apply this choice to every jpeg on your Mac.
    Then open Bridge and see if double-clicking opens it in Photoshop.
    Now that means all jpegs on your Mac will open in Photoshop.  Maybe you don't want that.
    You can set your jpegs to open in Preview when Bridge is closed.
    When you open Bridge, there is Preferences > File Type Associations where you can direct Bridge to open the jpegs in Photoshop when you are viewing in Bridge.

Maybe you are looking for