How to get path or parent folder

Hello
I'm overriding method extendedPreAddRelationship on class S_Relationship.
My purpose is to check whether the document is being put in the correct path or not.
I can get folder name and document name using following code:
AttributeValue av;
av = def.getAttribute(Relationship.LEFTOBJECT_ATTRIBUTE);
S_PublicObject folder = (S_PublicObject) av.getPublicObject(this.getSession());
av = def.getAttribute(Relationship.RIGHTOBJECT_ATTRIBUTE);
S_PublicObject document = (S_PublicObject) av.getPublicObject(this.getSession());
What I need is the whole path (or at least the parent folder). Can I get path somehow? Or should I try to search parent folders?
Jaska

My purpose is to check whether the document is being put in the correct path or not.Hi,
I had a similar problem - I needed to compare the path of current folder with path from parameters. Because I wasn't be able to get the path of folder, I did it in reverse way, comparing the folders. To get folder from path I needed getRootFolder method, which wasn't in server-side classes, so I extend S_TieFolder class:
* Analogy of LibrarySession.getRootFolder().
public static S_Folder getRootFolder(S_LibrarySession session)
throws IfsException
S_Folder folder = null;
try
Collection c = session.getValueDefaultCollection();
S_ValueDefault vd = (S_ValueDefault)c.getItems("RootFolder");
AttributeValue av = vd.getPropertyValue();
folder = (S_Folder)av.getPublicObject(session);
catch(Exception e)
throw new IfsException(21020, e, session);
return folder;
In extendedPreAddItem method of S_TieFolder:
S_Folder paramFolder = (S_Folder)getRootFolder(session).findPublicObjectByPath(folderPath);
if( this==paramFolder ) ...
Radek
[email protected]

Similar Messages

  • Getting path of parent folder of a file during a workflow execution

    How can I get the parent folder/directory of a file during the execution of a workflow? I cant't find any actions i Automator that will give me this.
    I want to make a general applicable automated workflow. The path can not be hardcoded in the workflow as different files and folders will be worked on each time the workflow is run.
    The input to the workflow is a file or list of files. I want to be able to retrieve the path of the parent folder of these files at runtime.
    Will I have to do this through AppleScript? If so, then how?
    (in case you have seen my first post on this; it seems I wasn't specific enough so people didn't understand what I want to do. Therefore this second post. Sorry for the iconvenience)

    Hi anilsen!
    If all selected files are within the same folder, it would be like this:
    For example:
    • Get Specified/Selected Finder Objects
    • Run AppleScript
    on run {input, parameters}
    tell application "Finder"
    set output to (container of item 1 of input) as alias
    end tell
    return output
    end run
    Spazek

  • How to get path of a specified file

    how to get path of a specified folder
    my code is as follows: Iam using struts 1.2
    my directory structure in tomcat/webapp is as afollows:
    sfq
    |
    | _ _xml
    | |     
    | |_ _ sqx_read.xml
    |
    |__jsp
    |
    |__WEB-INF
         |
         |_ _classes
              |
              |_ _ReadXml.class
    Now i have to get the path of a sql_read.xml file which is in xml folder from ReadXml.java file. pls it's urgent

    Urgent or not, you can obtain the document root directory as
    ServletContext.getRealPath("/")

  • How to get path of downloaded file?

    Hi,
    I use JDeveloper 11g with ADF.
    I have to download file with original date. If i want to save date i have to zip file. After that to unzip. My queation is: when clien download file how to get path of downloaded file????
    Because, i want to save unziped file on location where client want to download.

    Hi,
    you cannot download a file directly to a client. If this is a requirement then you need a signed Java Applet to handle the download. Otherwise a download dialog is opened for the user to define where to store the file.
    Frank

  • How to get to user startup folder in windows 7

    How to get to user startup folder in windows 7

    Unfortunately your post is off topic here, in the TechNet Site Feedback forum, because it is not Feedback about the TechNet Website or Subscription.  This is a standard response I’ve written up in advance to help many people (thousands, really.)
    who post their question in this forum in error, but please don’t ignore it.  The links I share below I’ve collected to help you get right where you need to go with your issue.
    For technical issues with Microsoft products that you would run into as an
    end user of those products, one great source of info and help is
    http://answers.microsoft.com, which has sections for Windows, Hotmail, Office, IE, and other products. Office related forums are also here:
    http://office.microsoft.com/en-us/support/contact-us-FX103894077.aspx
    For Technical issues with Microsoft products that you might have as an
    IT professional (like technical installation issues, or other IT issues), you should head to the TechNet Discussion forums at
    http://social.technet.microsoft.com/forums/en-us, and search for your product name.
    For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), you should head to the MSDN discussion forums at
    http://social.msdn.microsoft.com/forums/en-us, and search for your product or issue.
    If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here:
    http://community.dynamics.com/
    If you really think your issue is related to the subscription or the TechNet Website, and I screwed up, I apologize!  Please repost your question to the discussion forum and include much more detail about your problem, that could include screenshots
    of the issue (do not include subscription information or product keys in your screenshots!), and/or links to the problem you’re seeing. 
    If you really had no idea where to post this question but you still posted it here, you still shouldn’t have because we have a forum just for you!  It’s called the Where is the forum for…? forum and it’s here:
    http://social.msdn.microsoft.com/forums/en-us/whatforum/
    Moving to off topic. 
    Thanks, Mike
    MSDN and TechNet Subscriptions Support

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string path=@"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
                    dataGridImage.Controls.Add(filePaths[i]);
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    try
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    MessageBox.Show(e.Message);
    continue;
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    images.Controls.Add(card);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • Display path to parent folder of bookmark

    It's been 3 weeks and no new nibbles so I'm tossing this chum back into the community waters.
    '''Key phrase below: I WOULD STILL LIKE TO SEE THE PATH...'''
    Another article showed me how to use the Parent Folder add-on to display the (duh) parent folder of a bookmark (see: https://support.mozilla.org/en-US/questions/855436?e=es&as=aaq ).
    While this was very helpful, I would still like to see the PATH to that folder in the display when searching for a bookmark.
    This functionality is present in Windows 7 (it's called Search. See http://windows.microsoft.com/en-US/windows7/help/videos/finding-your-files ).
    With over 12K bookmarks, managed as only a librarian can, I not only need to locate bookmarks for retrieval, but want to save new bookmarks to the "correct" folder. The path allows me to do this.

    I think you misunderstood (which was why I included the link to the Microsoft Windows 7 page). Before Firefox I used IE9 but both browsers run under Windows 7. I'm basically looking to emulate the functionality of the W7 Search tool when using Firefox (which the Parent Folder add-on tries to do, but not fully). Hope that clears things up?

  • How-to get path to a node in SPRO

    Hello guys,
    I'm working on a tool which creates automatic dcumentation tool of changes in SPRO. All goes fine except one thing:
    I need to generate a PATH to IMG ACTIVITY. I know the code of activity, I know it's HIER_GUID. What I need to get is all "parents" HIER_GUID of bottom node.
    So far I got only one FM - STREE_GET_PATH_TO_NODE. It's fine but it returns only the path to 03 level in SPRO. (01 - is top, 02 - are components).
    What I desperatly need is how to get a connection from 03 to 02 level.
    You can simulate the FM with following values:
    SEARCH_FOR_NODE-NODE_ID = 1C1B49FEC279D411AB74009027B70B8E
    SEARCH_FOR_NODE-TREE_ID = 367A8DF9ACEE16E7E10000009B38F976
    The result contain the highest node id 367A8DAFACEE16E7E10000009B38F976, which stands for "SAP Business Parnter" (according the table TNODEIMGT-NODE_ID).
    But the fact, that "SAP Business Partner" is in "Cross-Application Components" is unreachable for me.
    Do you know, how to get relevant node on level 02 ?
    All hints will be rewarded.
    Thank you
    Regards
    Tomas

    Hello guys,
    I'm working on a tool which creates automatic dcumentation tool of changes in SPRO. All goes fine except one thing:
    I need to generate a PATH to IMG ACTIVITY. I know the code of activity, I know it's HIER_GUID. What I need to get is all "parents" HIER_GUID of bottom node.
    So far I got only one FM - STREE_GET_PATH_TO_NODE. It's fine but it returns only the path to 03 level in SPRO. (01 - is top, 02 - are components).
    What I desperatly need is how to get a connection from 03 to 02 level.
    You can simulate the FM with following values:
    SEARCH_FOR_NODE-NODE_ID = 1C1B49FEC279D411AB74009027B70B8E
    SEARCH_FOR_NODE-TREE_ID = 367A8DF9ACEE16E7E10000009B38F976
    The result contain the highest node id 367A8DAFACEE16E7E10000009B38F976, which stands for "SAP Business Parnter" (according the table TNODEIMGT-NODE_ID).
    But the fact, that "SAP Business Partner" is in "Cross-Application Components" is unreachable for me.
    Do you know, how to get relevant node on level 02 ?
    All hints will be rewarded.
    Thank you
    Regards
    Tomas

  • How to get path to file variable with applescript

    I've tried:
    `set file_path to path of myfile`
    but it's giving me error:
    `error "Finder got an error: Can’t get path of document file ..."`

    Code is:
    set theFolder to (choose folder with prompt "Select the start folder")
    set file_list to every file of theFolder
    repeat with myfile in file_list
        set file_name to name of myfile
        set file_path to path of myfile
        log (file_path & "/" & file_name as string)
    end repeat

  • How to get path of jar file

    I am using a class which is present in a jar file.
    There are lot of versions of this jar file are present on machine.
    I am accessing one class from this jar.
    How do I know which jar is used by application.
    How to get the path(path on machine like c:\java\lib) of this jar file.

    URL jarURL = this.getClass().getResource("/whatever.class");will return you a jar:// URL. Experiment with that. (Remember that "whatever.class" needs to be prefixed by the full name of the package the class is in.)

  • How do I hide the parent folder of the user home folders in File Sharing?

    In 10.6 Server I would set the parent folder so that "Everyone" could not list folder contents, then set "Everyone else" read only.  This prevented the parent folder from showing up in the list of available Share Points and allowing users to see the list of home directories.
    In 10.8, this trick no longer seems to work.  No matter what I set the ACLs to, the folder always shows up as a share point in the connection window.  2014 is the folder I've set for the Home directories of our network users (and there will be 2 more for graduating years.)  I can set the ACL so if they attempt to mount it, it just spits out an error saying they can't view the contents, but that isn't reasonable.  I don't want it to show up at all.  The only thing the students should see is their home folder.  Nothing else.
    What can I do to make it so 2014 doesn't show up in the connection window?  2014 is the parent folder for the home directories, so it can't be unshared.

    This prevented the parent folder from showing up in the list of available Share Points and allowing users to see the list of home directories.
    That second sentence should read:
    This prevented the child folder (parent folder to the home directories) from showing up in the list of available Share Points and allowing users to see the list of home directories.

  • How to get the last sub folder value from the string in Webi report

    I have an object coming from universe, this object will contain string e.g. \\Users\Public\Pictures\Sample\
    or    \\Users\Doc\BI\BO\Webi\
    I need the last sub folder from this path to be displayed i.e. Sample and Webi.
    I would like to know how it can be done.
    I tried using formulas like POS, SubStr and Length. however the issue is that the length of the the sting is not fixed and the number of "\" are also not fixed.
    I would appreciate any help regarding this.
    Regards,
    Yogesh

    Hi,
    What is the formula you have written though?.
    =length(right([folderpath]);pos([folderpath];"\")+1)
    Thanks,
    Jothi

  • How to get path of a VI used in LV project?

    How can I get the path of a VI used in LabVIEW project?
    Actually I want to replace the VI used in LV project by saome other VI, and I think it can be done if I get the path of the VI already present in project and replace that path with path of the VI which I want to include in that project.

    There are several ways to replace a VI, say "MyFirstVI", with another, say "MySecondVI".  The method you use will depend on several factors, including
    the version of LabVIEW you are running
    whether the VIs are in a LabVIEW Project or not (if they are, I'm assuming they are in the same Project)
    whether you want to replace all MyFirstVI instances with MySecondVI, or selected ones
    the size (number of VIs) of the Project.
    As noted, if you want to replace all of MyFirstVI with MySecondVI in a Project, here is one way to do this:
    Close the Project.  You do not want to do this with Project open.
    Rename MyFirstVI to MyOldFirstVI.
    Rename MySecondVI to MyFirstVI.  If MySecondVI already exists in the Project, you might want to Copy it instead of Rename.
    Open the Project.  Find and open an instance of MyFirstVI, verify it has the code of MySecondVI.
    In Project Explorer, find MyFirstVI and rename it MySecondVI.
    Exit Project.  Rename MyOldFirstVI back to MyFirstVI.
    At this point, all of your VIs have their "original" names, but in, say, Main.vi, wherever MyFirstVI was called, you should see MySecondVI.
    For doing selective Replacement (or even total replacement where you want to actually see all of the instances where replacements are made), you can use QuickDrop to your advantage.  You need to have in memory the VIs that use MyFirstVI, and also have MySecondVI in memory.  With the Project open and the relevant VIs in memory:
    Open any VI that shows MyFirstVI on the Block Diagram.  Right-click it and choose "Find All Instances".
    When the search is done, you need to "visit" each of the found VIs -- use Ctrl-G to do this.
    When you find an instance of MyFirstVI, type Ctrl-Space to activate QuickDrop, start typing MySecondVI until it appears on the Selection line (if you are lucky, you will only need to type MySec and it will find the correct VI), then type Ctrl-P to replace MyFirstVI with MySecondVI.
    Type another Ctrl-G to go to the next instance of MyFirstVI and replace as needed.  When you've replaced all of them (or all that you want to replace), stop.
    Bob Schor

  • How to get path

    Hello
    How do I get the current path an object is executing from? This is for a simple test. I have a file I want to open up within my object. That file is being copied to the .class directory where my object is. I just want to figure out how to use some static method of the Class to find where it is so I can use it. I am sure this is the wrong way to do it, if even possible. I just need this as a "throwaway" technique. tia.

    See http://www.rgagnon.com/javadetails/java-0076.html

  • How to get Top most parent Taskflow Id at runtime?

    Hi,
    I am working on a portal site and I need to get the parent Id of the current taskflow at runtime.
    Following is the code through which I get the current taskflow Id.
    ControllerContext cctx = ControllerContext.getInstance();
    ViewPortContext currentViewPort = cctx.getCurrentViewPort();
    TaskFlowContext taskFlowCtx = currentViewPort.getTaskFlowContext();
    TaskFlowId taskFlowId = taskFlowCtx.getTaskFlowId();
    String taskFlowName = taskFlowId.getFullyQualifiedName();
    But How can I get the parent Id if this taskflow is embedded within some taskflow(s). I want to get the top most parent Id.
    Your help is appreciated.
    Thanks,
    Jaykishan

    Hi, i tried this code but i'am getting ClassCastException.
    ControllerContext cctx = ControllerContext.getInstance();
    ViewPortContext currentViewPort = cctx.getCurrentViewPort();
    ChildViewPortContextImpl c = (ChildViewPortContextImpl)currentViewPort; (get error here oracle.adfinternal.controller.state.RootViewPortContextImpl cannot be cast to oracle.adfinternal.controller.state.ChildViewPortContextImpl)
    Object pViewPort = c.getParentViewPort();
    ViewPortContext parentViewPort = (ViewPortContext)pViewPort;
    String parentTaskFlowId = parentViewPort.getTaskFlowContext().getTaskFlowId().toString();
    how did you manage to make work ?

Maybe you are looking for