File.seperator works only with ClassLoader.getResource

Hello

In my model project, I use the following code to get the full path of a file of properties inside my model project.

String seperator = File.separator;

ClassLoader loader is Thread.currentThread () .getContextClassLoader ();.

Path = String

separator 'com' + separator + 'projectName' + separator + 'model' + separator + 'utils ' +.

seperator + "cadUtilityStore.properties";

URL url = loader.getResource (path);

String completPath = url.getPath ();

On my windows machine loader.getResource (path) returns null so that if I use / as a delimiter it TR returns the correct path.

Should not work File.separator for windows and linux machines?

Thank you

Elias.

File.separator shouldn't work for windows and linux machines?

Yes

On my windows machine loader.getResource (path) returns null so that if I use / as a delimiter it TR returns the correct path.

getResource() takes 'virtual' path as a parameter, you should always use "/" and not OS separator.

Dario

Tags: Java

Similar Questions

  • Files PPCS5 works only with PPCS6

    Hello everyone.

    I recently updated my CS5 to CC, and now I have the PPCS6 because CC is not available before the 17th. When I open some PPCS5 .mpg files with my CS5, all right.

    But when I open the PPCS5 with my PPC .mpg files, first the dialog box asks me if I want to convert the file and I click on OK, then the dose of file appear in my calendar, but when I scroll or click on play I don't see the film.

    Why the film must be converted

    why I can't see the movie

    Thank you.

    What are the details?

    Read Bill Hunt on a file type as WRAPPER http://forums.adobe.com/thread/440037

    What is a CODEC... a primer http://forums.adobe.com/thread/546811

    What CODEC is inside of this file? http://forums.Adobe.com/thread/440037

    .

    A report with details of codec your file, use the following programs... A screen capture works well for people to SHOW what you do

    http://forums.Adobe.com/thread/592070?TSTART=30

    .

    For PC http://mediainfo.sourceforge.net/en or http://www.headbands.com/gspot/

    For Mac http://mediainspector.massanti.com/

  • External speakers work only with powerpoint.

    External speakers work only with powerpoint. DVD, internet, music files, are not. They worked for the first few weeks.

    I have a HP dv7-6c27cl with intel core i5 and Windows 7.

    When I have the system check it, it finds no problem.  Apparently, I have the latest drivers. The fact that the speakers work with powerpoint, which is confusing.

    When I play a video file or music, I get an error message: "Windows Media Player has encountered a problem while playing the file."

    The headset works for internet but not DVD.

    I've installed Weatherbug a week ago and had to uninstall other garbage that come with it. I think that's when the problem started.

    Well, I set myself just now. I did a system restore to a point before that I installed Weatherbug, and now everything's fine.

  • CS6 Production Premium supports AMD graphics cards? Specifically over-pants M6100. If so, all the features work with the M6100, or are there features that work only with nVidia video cards?

    CS6 Production Premium supports AMD graphics cards? Specifically over-pants M6100. If so, all the features work with the M6100, or are there features that work only with nVidia video cards?

    CS6 does support OpenCL and OpenGL?

    Are all features that CS6 supports for NVidia Cuda available for the M6100 OpenCL?

    Bill supposed to first Pro CC (not CS6) response. Windows of Premiere Pro CS6 version does not support OpenCL for accelerating GPU of MPE. Therefore, there is no "opencl_supported_cards.txt" file in the folder of Premiere Pro, and the code to OpenCL is disabled permanently in all versions of Windows from Premiere Pro CS6. So, for your over-pants M6100 Premiere Pro CS6 will be permanently locked to only software MPE mode. (Acceleration GPU of MSES in the Windows of Premiere Pro CS6 version is limited to the CUDA only, which means that only NVIDIA for GPU - no AMD over-pants or GPU Radeon support CUDA at all.)

  • RoboForm does not work with your new browser. It is very fustrating and works only with Windows Explorer. I need to reinstall the old FIREFOX program?

    RoboForm does not work with your new browser. It is very fustrating and works only with Windows Explorer. I need to reinstall the old FIREFOX program?

    RoboForm has already released a version with support for the latest version of Firefox. See http://www.roboform.com/support/news. Try upgrading to the latest version of Roboform.

  • Windows 7 works only with canon MX 340

    Canon MX 340 printer works only with windows 7.

    Canon MX 340 printer works only with windows 7.

    You mean the Canon PIXMA MX340?

    You have the following drivers installed? :
    http://www.USA.Canon.com/nw3s/CanonUSA/DownloadContents/English/0100461601EN.htm
    (As of 10/23/12)

  • can I create a pdf file that opens only with adobe

    Can I create a pdf file that opens only with adobe

    To answer question you directly, no, you can't do nothing to prevent a valid PDF file opens in a non Adobe Reader, for better or worse.

    -Dov

  • Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? Every month I pay an amount for PS and LR...

    After the upgrade to Windows 10 Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? I bought the license more than 1 year ago. Every month I pay an amount for PS and LR, and for the past 4 months I can't work. Russian support team cannot solve this problem and sent me here.

    Thank you! I reset my password, the problem was in it.

  • DeskJet 722C works only with Windows 7

    OK, so I applied the DJ_Patch as described. (See http://h30434.www3.hp.com/t5/Printer-All-in-One-Software-and/Deskjet-710-720-810-820-100-Series-prin... ) I have Windows 7, 64-bit and a HP Deskjet 722 C printer.  Tried to print the test page, but received the error from the printer.  Tried to add a printer, you are looking for the 722C, but it is not on the list, even tried to do Windows Update to search for my printer.   Tried to restart, which did not work or the other.  Still get error printer.  I appreciate any other suggestions.  BTW, the printer is connected via a USB to parallel port cable.

    My HP Deskjet 722C now works!  I spent several hours trying different things only to find out it was the cable use to connect the printer to our new computer.  He is there not a lot of info on the package of cable but if you watched closely he said it worked only with Win XP, me and Vista.  Who would have thought that the cable wasn't working with some BONE... me!  Once we went and bought a new cable ($40, Ouch!), we were running a few minutes.  I don't know that a cheaper cable is available online.

    I wanted to post this in the hope of saving someone money, time and frustration on the other.

  • Adobe Acrobat dc works only with Microsoft office 2016

    Adobe Acrobat dc works only with Microsoft office 2016

    Hey Nick Villani,

    Desktop stand 2016 for Windows and MAC OS versions of Acrobat DC will be available in the next major update quarterly Acrobat, tentatively scheduled for October.

    Kind regards

    Ana Maria

  • I have the code for an Adobe Creative Cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code?

    Hi, I have a problem with code for my Adobe Creative cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code? is a subscription to creative cloud of throughout the year.

    Probably you have a redemption code... especially if you did not purchase directly from Adobe

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

    -or https://forums.adobe.com/thread/1572504

  • This calculator works only with round numbers

    I need help,

    This calculator works only with the numbers series, but is this 1.9 * 6 the result is 11.399999999999999 instead of 11.4

    Ware is the problem, can it be resolved?

    Theanks in advace.

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application ' xmlns:mx = ' http://www.Adobe.com/2006/MXML "layout =" " vertical " >

    < mx:Script >

    <! [CDATA]

    private function getTotal():Sub

    {

    var myInt:int = parseInt (input.text);

    var myFloat:Number = parseFloat (input.text);

    var myNumber:Number = new Number (Input.Text);

    var myInt2:int = parseInt (input2.text);

    var myFloat2:Number = parseFloat (input2.text);

    var myNumber2:Number = new Number (INPUT2. (Text);

    total. Data = (myNumber) * (myNumber2);

    }

    []] >

    < / mx:Script >

    < mx:TextInput id=" entry " />

    < mx:TextInput id=" INPUT2 " />

    < mx:TextInput id=" total " />

    < mx:Button " label = ' Button "click ="getTotal ();" />

    < / mx:Application >

    Welcome to the joys of IEEE 754 floating-point arithmetic. For more fun, try ".1 + 1 - 1»

    The simplest answer is probably to limit your result with Number.toFixed (). The answer is not so easy is to write your own class BigDecimal (in Java).

    --
    Maciek Sakrejda
    Truviso, Inc..
    www.truviso.com
    Truviso recruiting: http://www.truviso.com/company-careers.php?i=87

  • Is - this calculation Manager works only with EPMA?

    It seems calculation Manager works only with EPMA for the application of the classic plsnning, I cannot use the module of business rule and cannot use the Manager of computing to work on business rules, is good? correct me and advise, thank you!

    Sorry I disagree

    You can use the calc for classic version 11.1.1.3 planning
    When you create a planning application in 11.1.1.3 classic, you have the option to choose if you use business rules or calc for the app Manager.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • DeskJet F4180: F4180 driver works only with Windows 10

    Printer prints all bad, except the dark colors. Turns red magenta, green is dark blue etc.

    Printer worked fine with win xp.

    Test page prints perfectly without error

    Using the prints to photocopy an exact color copy - it's just data coming directly from the computer which is incorrect, so the work of does'nt driver properly with win 10. I checked that I have the latest version of the driver 6.1.7600.16385.

    I have noted this problem has already been spotted upward - when a new driver is available?

    or can anyone suggest a work around.

    Printer I tried with my laptop win10 and the fault has been the same.

    Printer I tried with my old desktop winxp and the rift was healed - perfect impression of a jpeg file.

    Reconnected printer back on my desk win10 and printed on the same jpeg file and printing was perfect!

    Have you tried a few other files that I had problems with and prints are very well - can only be assumed that the problem was down to the usb connector.

    Thanks for the help

    Concerning

  • LabVIEW 2009 .exe works only with windows 2000

    I created a simple vi with Labview 2009 for resetting a counter in the registry key. I changed it to an exe. The program works well on any machine with XP, but it does not work on the machine, that I need on which is running Windows 2000 SP4. I have installed the runtime of 2009, but I keep getting an error when it starts the vi is not executable and I need the full development to correct errors. But like I said it works everywhere else. I tried other exe wrote in LV2009 on this machine and they work. Is there something in my vi which is not compatible with Windows 2000?

    Thank you

    dkfire wrote:

    If you build an exe on a XP machine, then it will work only on XP.

    You need generate the exe on a Windows 2000 machine to make it work.

    Simply not true - even close to not being not right.

    Chris,

    My guess is that the .NET component is not present on the pc of w2k.

Maybe you are looking for

  • Cannot connect to a specific Web site

    For the last two weeks, I am unable to connect to a specific website (sharks.nhl.com). The user name and the password seem to go through fine (when I give a wrong password I get an error on the site), but the situation changes not connected. This pro

  • He can only get 4-bit color

    This morning started with my old computer as usual its got windows xp, however, the picture quality was very poor, is gone in the display panel, and then in settings and found that I have only... Lower quality of 4-bit color, it is the only available

  • ... I can no longer edit video in my Windows Movie Maker 6.0...

    ... After the loading of the Movie Maker,... (I get a pop up that says "collections of file is invalid or damaged a new collections file has been created...") ... I'm able to import my Panasonic Video Cam Suite 1.0, to my laptop HP Pavilion 6700,...

  • PIX 515 and VAC + card

    Hello I just installed a map VAC + in our pix 515. I can check if the card is installed and working properly. "sh worm" gives no information if the card is installed. Greatings Marc

  • Troubleshooting a NFS data store

    A vSphere 5.5 uses a database hosted by a NAS server and store accessible via NFS.It has always worked well.Now I see that some folders and files on the data store is not accessible, with messages like:Move the virtual machine< vm_name >Was able to c