Wrong File(parent, child) behaviour on Windows when child starts with one s

I've sent following problem report:
A DESCRIPTION OF THE PROBLEM :
On Windows when relative path starts from one slash it should be resolved from current disk (not current directory). This behaviour should be preserved for Files constructed with constructor File(parent, child). So results of run "System.out.println(new File(dir, relPath).getAbsolutePath())" and "System.out.println(new File(relPath).getAbsolutePath())" should be identical when running program from directory "dir".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run from directory C:\temp\relpath following code:
import java.io.*;
public class Main {
     public static void main(String[] args) throws Exception {
          System.out.println(new File("C:\\temp\\relpath", "\\temp\\relpath\\Main.java").getAbsolutePath());
          System.out.println(new File("\\temp\\relpath\\Main.java").getAbsolutePath());
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
C:\temp\relpath>java Main
C:\temp\relpath\\Main.java
C:\temp\relpath\Main.java
ACTUAL -
C:\temp\relpath>java Main
C:\temp\relpath\temp\relpath\Main.java
C:\temp\relpath\Main.java
The answer was:
I have been analyzing your problem and it is not a bug but the intended behavior of the API.
The File(File,String) constructor includes this in the specification:
"If the |child| pathname string is absolute then it is converted into a relative pathname in a system-dependent way."
In the example provided here, the child path is absolute so it is converted into a relative path. This is the intended behavior.
My comments:
First, child pathname is not absolute. Even so, I don't understand why this guy contend that this behavior is correct.
Please comment this!

Please comment this!
I've sent following problem report:
A DESCRIPTION OF THE PROBLEM :
On Windows when relative path starts from one slash
it should be resolved from current disk (not current
directory). This behaviour should be preserved for
Files constructed with constructor File(parent,
child). So results of run "System.out.println(new
File(dir, relPath).getAbsolutePath())" and
"System.out.println(new
File(relPath).getAbsolutePath())" should be identical
when running program from directory "dir".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run from directory C:\temp\relpath
following code:
import java.io.*;
public class Main {
public static void main(String[] args) throws
s Exception {
System.out.println(new File("C:\\temp\\relpath",
", "\\temp\\relpath\\Main.java").getAbsolutePath());
System.out.println(new
ew
File("\\temp\\relpath\\Main.java").getAbsolutePath());
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
C:\temp\relpath>java Main
C:\temp\relpath\\Main.java
C:\temp\relpath\Main.java
ACTUAL -
C:\temp\relpath>java Main
C:\temp\relpath\temp\relpath\Main.java
C:\temp\relpath\Main.java
The answer was:
I have been analyzing your problem and it is not a
bug but the intended behavior of the API.
The File(File,String) constructor includes this in
the specification:
"If the |child| pathname string is absolute then it
is converted into a relative pathname in a
system-dependent way."
In the example provided here, the child path is
absolute so it is converted into a relative path.
This is the intended behavior.
My comments:
First, child pathname is not absolute. Even so, I
don't understand why this guy contend that this
behavior is correct.
*/

Similar Messages

  • How do I eliminate the flashplayer window when it interferes with my viewing (e.g.) Weather Channel?

    How do I eliminate the flashplayer window when it interferes with my seeing the full window in (for example) the Weather Channel? I use Windows Vista, IE9, flash version 11.6.

    What you mean by "flashplayer window"; can you post a screenshot?  See http://forums.adobe.com/thread/1070933

  • Applications are mentioned free, but when we start downloading one dollar is charged in my credit card, but only for the first time when i switch on and use it for the first time one dollar is charged. and from next application it is free. why?

    Applications are mentioned free, but when we start downloading one dollar is charged in my credit card, but only for the first time when i switch on and use it for the first time one dollar is charged. and from next application it is free. why?

    Kindly inform any email id or toll free number to contact apple for your below answer, Mr.King_Penguin
    About receiving my credit card being debited for Free App Store Application downloads,
    It should be within a few days, but it might vary a bit by bank/provider :
    I am in India, if the bank don't refunds , what to do?
    Rajagopal.pngr :-  It is only a holding charge, it is not a permanent charge. If it isn't refunded within a few days or so (and it quite possibly won't be over a weekend) then you can query the charge with Apple.

  • How do I maximize a window to full screen with one click?

    How do I maximize a window to full screen with one click? Lion 10.7.4.

    If it is a full sceen App, some are some aren't, just click the arrow icon in the upper right hand corner.

  • Load Parent-Child dimension with attributes by rule file

    Well, I've cracked my head open while banging against this wall.
    Task is plain & simple:
    How can I load build dimension from such table, using rule file?
    Data
    ProductParent ProductChild ProductAttribute
    Balls Ball_8 Round
    I want to load both product dimension and attribute by single rule file (neither of these dimensions exists in database before load), so I do the following:
    1) Set dimension build settings, creating dimension Products (marking it P\C generated, sparse), having an attribute dimension AttributeDim
    2) Mark the fields as Parent, Child and AttributeDim of dimension Products
    After loading rule file a get three types of errors:
    a) "Base member (Balls) association level does not match base dimension association level" -- does this mean that I cannot assign attributes in P\C way?
    b) "Record #327 - Can not uniquely identify member by Balls (3335)
    Balls     Ball_8     Round" -- That's strange, I thought member should be identified by Ball_8 (and this column is unique)
    c) "\\Record #418 - Error in association transaction [Ball_8] to [Round] (3362)"
    I've read all I could find on topic from this forum, network45 board and going to start my way through metalink3, but maybe some kind soul will rescue me from drowning in information ocean?

    Hi,
    Outline is blank at the start of load and I expect dimensions Product and ProdAttribute to be added.
    Generations are unapplicable, since I can't turn this parent-child dimension (it's ragged) into generation one.
    And, by the way Integration Services manages to do this somehow, why rule files wouldn't?

  • Security on Employee Parent Child Dimension with SCD 2

    Hi
    I am looking for a solution for how to get all child members of a Parent employee including the one in the history. I tried multiple ways the problem which I am facing are
    Scenario 1: When I am using this approach, since the Employee with 'Jump' as employee id do have a history record with no children under him I am getting 'Null'. But there are new records (last 3 SCD changes) where he has employees under him.
    SELECT descendants(
    // Check if current employee is a manager
    iif(hierarchize(exists([Employee].[Manager Employee Dim ID].members,
    (strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))),post).item(0).item(0).parent.datamember is
    hierarchize(exists([Employee].[Manager Employee Dim ID].members,
    (strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))), post).item(0).item(0),
    // End of check if current employee is manager
    hierarchize(exists([Employee].[Manager Employee Dim ID].members,
    (strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))),post).item(0).item(0).parent,
    hierarchize(exists([Employee].[Manager Employee Dim ID].members,
    (strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))), post).item(0).item(0))) ON 0,
    [Measures].[Aggregate Count] On 1
    FROM [Data Ware House]
    Scenario 2: When I put a filter (as a set) to check if the record is current then I am getting the latest record for employee 'Jump'. But here the problem is that the employee under him I am only getting the [Measures].[Aggregate Count] of the latest
    change only.
    SELECT descendants(
    // Check if current employee is a manager
    iif(hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
    (strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])),
    post).item(0).item(0).parent.datamember is
    hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
    (strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])), post).item(0).item(0),
    // End of check if current employee is manager
    hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
    (strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])),
    post).item(0).item(0).parent,
    hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
    (strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])), post).item(0).item(0))
    ) ON 0,
    [Measures].[Contract Change Aggregate Count] ON 1
    FROM [Data Ware House]
    If any one can help me out with this that will be helpful.
    What I need is all the members under the employee 'Jump', including the Old scd records for 'jump'
    regards
    Robin
    Robs

    Hi,
    Outline is blank at the start of load and I expect dimensions Product and ProdAttribute to be added.
    Generations are unapplicable, since I can't turn this parent-child dimension (it's ragged) into generation one.
    And, by the way Integration Services manages to do this somehow, why rule files wouldn't?

  • Hide parents in a parent-child hierarchy with dynamic rights

    Hi all,
    I'm facing the following issue with dynamic rights on a parent-child hierarchy:
    scenario:
    - a cube with a company parent-child hierarcy
    - dynamic security on through a role on dimension data based on a list with user (login names) and their
    departments, with Enable
    Visual Total is switched ON 
    - Multiple facts connected to this hierarchy.
    When a user connects to the cube (in this case with Excel or through a dashboard in Performance Point services) he/she is allowed to see the facts belonging to theirs departments and all child departments, so far so good. But the totals of the facts are
    repeated for all higher parents. Now i know thats nog 'wrong' but our users think thats very confusing in some cases, so is there a way
    - to hide the parents in the hierarhcy
    - or to set all the parent measures to null/empty?
    I prefer to make a solution in the cube so that all client programs can benefit from this solution.
    thanx in advance for all input!

     so that User A have scope: [Dimension_Name].[Attribute XYZ] and User B: [Dimension_Name].[Attribute ABC] ?
    Hi Wilfred,
    If I understanding correctly, you want different user can see different dimension attributes based on the different right on role, right? 
    Based on my research, it seems that there is no a directly way to achieve this requirement. What we can do is that "Deselect all members" for each attribute of the dimension in Dimension Data tab, which will hide all members of the dimension for the role.
    Even the dimension metadata is visible in the cube in clients, its members can't be seen. Here are some useful links for your reference.
    http://saysmymind.wordpress.com/2013/01/15/hide-a-specific-attribute-hierarchy-in-role-playing-dimension-ssas-multidimensional/
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e2596eec-7c2d-48c0-8e81-538a8c632360/hide-dimension-based-on-roles
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How do I get Firefox to open in a new tab (instead of a new window) when I click on one of my buttons in my toolbar?

    When I click on one of my buttons in the toolbar, Firefox opens that button in a new window. I would like to be able to click on one of my buttons and Firefox open it in a new tab instead.
    == This happened ==
    Every time Firefox opened
    == When I attempt to click on a button

    Right click the FireFox button in your toolbar and look in the properties- middle tab...make sure that it only has "C:\Program Files\Mozilla Firefox\firefox.exe" with no other link added to the end. I had a similar problem this morning and found a website had attached it's link to the end so it would always pop up first and would only open a new tab.
    Hope that fixed it.

  • Parent Child relation in one transaction throws error... (

    In nutshell, I have a parent->child relation ship in DB and due to the UI requirement, I created view link as Child->parent, it is giving a hack a lot of problems.... (it sounds silly but looks like I am loosing my mind over this)
    Let me explain my situation,
    - I have a table A with col-a and col-b. I have another table B with col-a (primary key) and col-c. (This way table A is a parent table)
    - ON UI side i created relationship like table B is parent and Table A is child using col-a
    - I need to create parent-child (one record for each) record programatically.........
    I tried following thing:
    - from backing bean, as soon as i create Table-B row first, i get error saying too many objects with same key (which is understandable because of table design..... and associaion must be throwing that error)
    - from EOImpl file, it doesn't even find the child record being created... so during commit I can't send the foreign key value from Table-a to Table-b
    Any suggestion is greatly appreciated?
    Thank you,
    -Raj

    that depends on how you implement the multiple selection of orders.. you have to pass the selectedValues to the backend or store the values in a map or list and pass it..

  • I am no longer able to use a keyboard shortcut to close a window when there is only one window open.

    I can use Command+W when there are multiple tabs open to close one window at a time, but not when there is only one window remaining. It's driving me crazy because I have to click on the red dot. It won't close with File > Close either. Nothing changed (that I know of) from last week to this that would cause this. It works fine in safe mode but I can't figure out what's conflicting. Also, I've tried reinstalling Firefox but that did nothing. Help?

    Problem solved! It's the Evernote add-on. They updated something on November 6. I've disabled it until that quirk is fixed. Thanks.

  • OBIEE Parent-Child Dimension with multiple hierarchies

    Is it possible to have in a parent-child dimension multiple hierarchies? I want to have the same botom childs to aggregate to different parrents. example.
    Account Dimension
    HR1-total
    HR1-parrent1
    CHILD1
    HR1-parrent2
    CHILD2
    HR2-total
    HR2-parrent1
    CHILD1
    CHILD2
    Thanks in advance.

    No, it is not possible to have multiple hiearchies in a PC logical dimension.
    The concept of the Parent-Child (PC) hierarchy is completely different from the level-based hierarchy. Specifically the PC hierarchy expects a predefined / architected table with corresponding PC column/value structuring with or without attributes.
    Short story even shorter it is not possible.
    Longer...
    In the RPD the BMM actually prevents you from adding a new logical level, child level, or parent level when you have selected that the logical dimension be a parent child logical dimension with Parent-Child hierarchy.
    On another note...
    Have you tried architecting/building your PC source table so that it represents the roll-up and bottom child-levels like you are seeking? That is, that same member in the child column more than once having a separate parent value. That should be doable.
    That was a great question, please award points if this answered your question or it was helpful.
    Cheers,
    Christian
    http://www.artofbi.com

  • How do I move my iTunes files from an old computer (Windows XP) to a new one (Windows 7 Professional)?

    Can anyone tell me how to move my iTunes music and book files from an old computer running Windows XP to my new one running Windows 7 Professional?  Do I download and install iTunes on the new system then use the backup and restore functions?  If so, it looks like the backup only goes to CDs or DVDs; there are so many files that using a USB drive would make more sense, but that does not appear to be an option.  Would it work to simply copy the iTunes folder under My Music to the new computer and assume that iTunes would find it?  Thank you, very much, for any help and guidance.

    Apple has tutorial and FAQ articles on moving and importing here:
    http://www.apple.com/support/itunes
    There is a great set of articles on iTunes and how to over on
    http://www.ilounge.com
    http://www.ilounge.com/index.php/articles/comments/moving-your-itunes-library-to -a-new-hard-drive

  • How to model parent child relationship with DPL? @Transient?

    Hello All,
    I want to model a parent entity object with a collection of child entities:
    @Entity
    public class Parent{
    @PrimaryKey
    String uuid;
    List<Child> children;
    @Entity
    public class Child{
    @PrimaryKey
    String id;
    I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
    If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
    Thanks in advance,
    Steven
    Harvard Children's Hospital Informatics Program
    Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PM

    Hi Steven,
    The definition of persistence is here:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
    And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
    So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
    In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
    I suggest looking at this javadoc:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
    as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • HWS file error when not starting with Ch 0

    Hello,
    I used the "niScope EX Save to File - HWS Low Level - Single Channel Stream.vi" as my starting point and added 8 channels for a 5105 card. Although this is a complex Queue-based vi, it works fine as long as my RAID is fast enough.
    However, we have need to take data from channels 4 to 7 and not start with Ch 0. When I do this, my LabVIEW HWS reader does not see any data, nor does the MATLAB code I have written to read our HWS files.
    Looking at the file in HDFView, I see that the data starts in vector0 and not vector1, as when I record Channels 0 to 3.
    Perhaps I need to use the HDF5 LabVIEW code to force the writing to a different location in the HDF file?
    Thanks for your help.

    Hello,
    I was out of the office Mon. and Tues. I took out a section that just collects one 5105 card in a steaming, continuous collect mode. This is part of a much bigger VI and I included the “Helper Aps” folder that has all the sub-VIs for that larger app. There are more sub-VIs than you need for “5105 Cont Collect.vi”, but it should run once you tell it where the sub-VIs are. Included is a quick-look reader I use to look at the data.
    The data file Ch_0_to_3_5105-0.hws can be read, but the Ch_4_to_7_5105-0.hws file cannot.
    Thank you for your help.
    Attachments:
    5105_Cont_Collect.zip ‏3267 KB

  • How do I stop firefox from opening multiple windows when opening a new one

    I start firefox my homepage comes up - perfect....
    i minimize this window to open a new window
    when i open the new window it opens the first one also so then i have to go minimize the window again
    This just started after i updated Firefox
    How do I fix?

    Check the Home page setting: [[How to set the home page]]: Firefox supports multiple home pages separated by '|' symbols
    See this article for some suggestions: [[Firefox has just updated tab shows each time you start Firefox]]
    See also http://kb.mozillazine.org/Preferences_not_saved and [[Preferences are not saved]]

Maybe you are looking for

  • Passing value from ADF to BPEL, and to PL/SQL  procedure

    1. I have created BPEL which take 2 inputs and concatenate them. 2. have created a PL/SQL procedure for invoking this BPEL( working fine). Now i need to create a simple ADF page which contain 2 text box, 2 for input and 1 for result(concatenate), thi

  • Brief periods of silence during music playback

    Hi folks,            I have an iPhone4 with iOS7.0.4 installed. Occasionally, during playback of music using the inbuilt music player, some songs will have brief periods of silence in them. It generally lasts for maybe a second?  I've only started ex

  • GreenPower battery saving app and "my Xperia" service

    I have recently migrated from an iPhone to Sony Z1 on EE, and I have been pretty happy with this transition. The only thing I have noticed is that the Stamina mode was not performing as I was hoping, so I downloadd a third party battery saving app ca

  • MOVED: MSI Live Update not working Windows XP Professional 64bit Edition!!!

    This topic has been moved to Operating Systems. MSI Live Update not working Windows XP Professional 64bit Edition!!!

  • Html buttons and event handlers

    There are three html buttons, each of them takes the user to a particular page once selected. I know an onClick method as follows but what comes after this??: out.println("<P ALIGN=CENTER ><INPUT TYPE=submit value=ENTER onClick...............>"); If