JTree and file directory

I'm messing with using a JTree to list folders for file selection. I have this class that I'm just using to get a grip on this with, but I'm stuck now. Basically I get it reading the directories, but when I add the next round of folders, it gets added on the "C:/" node instead of the node that was clicked on.
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.*;
import javax.swing.*;
import javax.swing.tree.*;
public class JavaTest extends JFrame{
     public class TreePanel extends JFrame{
          Container gcp = getContentPane();
          File dir;
          String filePath, dlim, selectedFile="", path;
          DefaultMutableTreeNode folders;
          TreePath selPath;
          JTree tree;
          public TreePanel(String name){
               super(name);
               gcp.setLayout(new BorderLayout());
               gcp.add(new FileListPanel(), BorderLayout.CENTER);
               setVisible(true);
          private class FileListPanel extends JPanel implements ActionListener{
               public FileListPanel(){
                    dir = new File("c:/");
                    String[] files = dir.list();
                    DefaultMutableTreeNode topNode = new DefaultMutableTreeNode("Files");
                    folders = new DefaultMutableTreeNode("C:/");
                    topNode.add(folders);
                    folders = getFolders(dir, folders);
                    tree = new JTree(topNode);
                    tree.setVisible(true);
                    JScrollPane listScroller = new JScrollPane(tree);
                    listScroller.setPreferredSize(new Dimension(200,200));
                    listScroller.setAlignmentX(LEFT_ALIGNMENT);
                    add(listScroller);
                    MouseListener mouseListener = new MouseAdapter(){
                         public void mouseClicked(MouseEvent e){
                              try{
                                   if(e.getClickCount()==1){
                                        selPath = tree.getPathForLocation(e.getX(), e.getY());
                                        path=selPath.getLastPathComponent().toString();
                                        dir = new File(path);
                                        folders = getFolders(dir,folders);
                                        tree.updateUI();
                              }catch(NullPointerException npe){
                    tree.addMouseListener(mouseListener);
               public DefaultMutableTreeNode getFolders(File dir, DefaultMutableTreeNode folders){
                    File[] folderList = dir.listFiles();
                    int check=0;
                    for(int x=0;x<folderList.length;x++){
                         if(folderList[x].isDirectory()){
                              folders.add(new DefaultMutableTreeNode(folderList[x]));               
                    return folders;
               public void actionPerformed(ActionEvent e){
     public static void main(String[] args){
          JavaTest jt = new JavaTest();
          TreePanel tp;
          tp = jt.new TreePanel("test");
          tp.setVisible(true);
          tp.setSize(300, 300);
          tp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}this line:
folders = getFolders(dir,folders);
is the problem. I don't want to add it to 'folders' I need it to be added to the tree node that was clicked on but I don't see how to get DefaultMutableTreeNode item. I can get a string representation of it, but that doesn't help.

Maybe this will help
tjacobs.tree.FileSystemTreeModel
=========================
package tjacobs.tree;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.tree.DefaultTreeCellEditor;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import tjacobs.io.IOUtils;
import tjacobs.io.DataFetcher;
import tjacobs.ui.util.WindowUtilities;
public class FileSystemTreeModel implements TreeModel {
     File mRoot;
     ArrayList<TreeModelListener> mListeners = new ArrayList<TreeModelListener>(1);
     public FileSystemTreeModel() {
          File f = new File(".");
          f = f.getAbsoluteFile();
          File par = null;
          do {
               par = f.getParentFile();
               if (par != null) {
                    f = par;
               else {
                    setRootFile(f);
                    return;
          } while (mRoot == null);
     public FileSystemTreeModel(File root) {
          setRootFile(root);
     private void setRootFile(File root) {
          mRoot = root;
     public void addTreeModelListener(TreeModelListener l) {
          mListeners.add(l);
     public Object getChild(Object parent, int index) {
          try {
               File fi = (File) parent;
               File[] subs = fi.listFiles();
               if (index < subs.length) {
                    return subs[index];
          catch (ClassCastException ex) {
               ex.printStackTrace();
          return null;
     public int getChildCount(Object parent) {
          try {
               File fi = (File) parent;
               return fi.listFiles().length;
          catch (ClassCastException ex) {
               ex.printStackTrace();
          return 0;
     public int getIndexOfChild(Object parent, Object child) {
          try {
               File fi = (File) parent;
               File[] subs = fi.listFiles();
               for (int i = 0; i < subs.length; i++) {
                    File f = subs;
                    if (f.equals(child)) return i;
          catch (ClassCastException ex) {
               ex.printStackTrace();
          return -1;
     public Object getRoot() {
          return mRoot;
     public boolean isLeaf(Object node) {
          File f = (File) node;
          return (!f.isDirectory());
     public void removeTreeModelListener(TreeModelListener l) {
          mListeners.remove(l);
     public void valueForPathChanged(TreePath path, Object newValue) {
          //change the file system through the FileSystemTreeModel?
          TreeModelEvent ev = new TreeModelEvent(newValue, path.getPath());
          File f = (File) path.getPathComponent(0);
          boolean worked = f.renameTo(new File(f.getParent(), (String)newValue));
          if (!worked) {
               JOptionPane.showMessageDialog(null, "Rename Operation Failed");
          } else {
               for (TreeModelListener l : mListeners) {
                    l.treeNodesChanged(ev);
     public static class NodeRunner extends MouseAdapter {
          private JTree mTree;
          private OutputStream mOut;
          private OutputStream mErr;
          private String[] mExecFileTypes;
//          public void fetchedAll(byte[] buf) {}
//          public void fetchedMore(byte[] buf, int start, int end) {
//               System.out.println(new String(buf, start, end - start));
          public NodeRunner (JTree tree) {
               this(tree, System.out, System.err);
          public NodeRunner (JTree tree, OutputStream out, OutputStream err) {
               mTree = tree;
               mTree.addMouseListener(this);
               mOut = out;
               mErr = err;
          public void mouseClicked(MouseEvent me) {
               if (me.getClickCount() == 2) {
                    File f = (File)mTree.getSelectionPath().getLastPathComponent();
                    if (f.isDirectory()) return;
                    if (mExecFileTypes != null) {
                         boolean canExec = false;
                         String extension = IOUtils.getFileExtension(f);
                         for (String s : mExecFileTypes) {
                              if (s.equals(extension)) {
                                   canExec = true;
                                   break;
                         if (!canExec) return;
                    try {
                         String cmd = f.getAbsolutePath();
                         final Process p = Runtime.getRuntime().exec(cmd);
                         Runnable r = new Runnable() {
                              public void run() {
                                   IOUtils.pipe(p.getInputStream(), mOut);
                         Thread t = new Thread(r);
                         t.start();
                         r = new Runnable() {
                              public void run() {
                                   IOUtils.pipe(p.getErrorStream(), mErr);
                         t = new Thread(r);
                         t.start();
//                         InfoFetcher in = IOUtils.loadData(p.getInputStream());
//                         Thread t = new Thread(in);
//                         t.start();
//                         InfoFetcher err = IOUtils.loadData(p.getErrorStream());
//                         t = new Thread(err);
//                         t.start();
//                         InfoFetcher.FetcherListener flin = new InfoFetcher.FetcherListener() {
//                              public void fetchedAll(byte[] buf) {}
//                              public void fetchedMore(byte[] buf, int start, int length) {
//                                   try {
//                                        mOut.write(buf, start, length);
//                                   catch (IOException iox) {
//                                        iox.printStackTrace();
//                         in.addFetcherListener(this);
//                         err.addFetcherListener(this);
                    catch (IOException iox) {
                         iox.printStackTrace();
     public static void addExecExecution(JTree tree) {
          new NodeRunner(tree);
     public static void addExecExecution(JTree tree, String[] execExtensions) {
          NodeRunner nr = new NodeRunner(tree);
          nr.mExecFileTypes = execExtensions;
     public static void addExecExecution(JTree tree, OutputStream out, OutputStream err) {
          new NodeRunner(tree, out, err);
     public static void addExecExecution(JTree tree, OutputStream out, OutputStream err, String[] execExtensions) {
          NodeRunner nr = new NodeRunner(tree, out, err);
          nr.mExecFileTypes = execExtensions;
     public static void main(String[] args) {
          File f = new File(".").getAbsoluteFile().getParentFile();
          //System.out.println(f.getName());
          FileSystemTreeModel tm = new FileSystemTreeModel();
          //FileSystemTreeModel tm = new FileSystemTreeModel(f);
          JTree tree = new JTree(tm);
          FileSystemTreeModel.addExecExecution(tree, new String[] {"exe", "bat", "jar"});
          DefaultTreeCellRenderer rend = new FileSystemTreeRenderer();
          tree.setCellRenderer(rend);
          //tree.setCellEditor(new DefaultTreeCellEditor(tree, rend));
          tree.setCellEditor(new DefaultTreeCellEditor(tree, rend, new FileSystemTreeEditor(tree, rend)));
          tree.setEditable(true);
          JScrollPane sp = new JScrollPane(tree);
          WindowUtilities.visualize(sp);

Similar Messages

  • How get SharePoint Library Folders and Files directory structure in to my custom web site.

    Hi,
    Actually my requirement is, I would like to pass site name and document library name as a parameter and get a folders and files from the document library and form the directory structure by using Treeview control in my web site.
    How should i get? Using Web service / object model?
    Web service would return the dataset as a result so from that how could i form the directory structure using Treeview control.
    I will select specified files and folders then i ll update sharepoint document library columns for corresponding selected files.
    Can anyone help over this, that would be great appreciate.
    Thanks in Advance.
    Poomani Sankaran

    Hello,
    Here is the code to iterate through sites and lists:
    //iterate through sites and lists
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite site = new SPSite(webUrl)) {
    using (SPWeb oWebsite = site.OpenWeb())
    SPListCollection collList = oWebsite.Lists;
    foreach (SPList oList in collList)
    {//your code goes here }
    Then use RecursiveAll to get all files and folders.
    http://www.codeproject.com/Articles/116138/Programatically-Copy-and-Check-In-a-Full-Directory
    http://sharepoint.stackexchange.com/questions/48959/get-all-documents-from-a-sharepoint-document-library
    Here is the full code:
    http://antoniolanaro.blogspot.in/2011/04/show-document-library-hierarchy-in-tree.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Duplicate file and file directory

    Currently using 37.0.2
    Notice in my file directory I have two Mozilla Firefox folders.
    One has April 2015 dates.
    The other has February 2014 dates.
    Can I safely delete the Feb 2014 folder and its sub-directories?
    Thanks

    There are also old Visual Studio 8 folders with a number appended in the screenshot.
    Did you ever do a Windows System Restore?
    Yes, you can remove that folder.
    If you want to know what Firefox version it is then you can check the application.ini file in a text editor via "Open with".

  • Mapviewer and file directory for apps

    Hello,
    i have mapviewer 11 EA1 pre-deployed and oracle 10.2 data base. I want to build up a little data mart with an interface to mapviewer to use geographical card material. Every query should be handled inside a browser. So i want to use servlet and jsp.
    I've built a jsp which works well within jdeveloper(embedded oc4j client). I can see the card material within the brower. Now my question is where in the file system(windows xp) can i put my jsp and servlet to make queries from inside of a browser and "it runs of its own". If i would use tomcat it's something like localhost:8080/gis but how is it in combination with mapviewer. I don't want to separate the servlets for my data mart and the gis-query. All should be in one directory, naturally with subdirectories.
    Hopefully, someone can help me
    thanks a lot

    Hi,
    /Users/YourUsername/Library/Safari/Bookmarks.plist
    Copy it to the new machine and you should be fine.

  • How to append a file directory and its contents in a jTextArea

    how will i display the contents of this file and file directory in a jTextArea or ...let's say it will display the content of "c:/AutoArchive2007-05-24.csv" in a jTextarea
    say this file "c:/AutoArchive2007-05-24.csv"contains the ff:details
    user:jeff AutoArchive-Process Started at Thu May 24 15:41:54 GMT+08:00 2007
    and ended at Thu May 24 15:41:54 GMT+08:00 2007
    Message was edited by:
    ryshi1264

    use the append(...) to append data to the text area.

  • JTree, JList and file selection

    I have a file selection JPanel that I'm creating that has a JTree on the left representing folders and a JList on the right that should have the files and folders listed to be able to select. I have two problems at this point. First, and more important, when a folder is selected, the JList doesn't update to the files in the new folder and I don't see what's keeping it from working. Second, when clicking on a folder in the JTree, it drops the folder to the end of the list and then lets you expand it to the other folders, also it shows the whole folder path instead of just the folder name.
    This is still my first venture into JTrees and JLists and I'm still really new at JPanel and anything GUI, so my code may not make the most sense, but right now I'm just trying to get it to work.
    Thank you.
    public class FileSelection extends JFrame{
              Container gcp = getContentPane();
              File dir=new File("c:/");
              private JList fileList;
              JTree tree;
              DefaultMutableTreeNode folders;
              String filePath,selectedFile="", path;
              TreePath selPath;
              FileListPanel fileLP;
              FolderListPanel folderLP;
              JScrollPane listScroller;
              public FileSelection(String name){
                   super(name);
                   gcp.setLayout(new BorderLayout());
                   fileLP = new FileListPanel();
                   folderLP = new FolderListPanel();
                   gcp.add(fileLP, BorderLayout.CENTER);
                   gcp.add(folderLP, BorderLayout.WEST);
                   setVisible(true);
              private class FileListPanel extends JPanel implements ActionListener{
                   public FileListPanel(){
                        final JButton selectItem = new JButton("Select");
                        final JButton cancel = new JButton("Cancel");
                        final JButton changeDir = new JButton("Change Directory");
                        //add buttons
                        add(selectItem);
                        add(changeDir);
                        add(cancel);
                        //instantiate buttons
                        selectItem.setActionCommand("SelectItem");
                        selectItem.addActionListener(this);
                        changeDir.setActionCommand("ChangeDirectory");
                        changeDir.addActionListener(this);
                        cancel.setActionCommand("Cancel");
                        cancel.addActionListener(this);
                        final String[] fileArr=dir.list();
                        fileList = new JList(fileArr);
                        fileList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
                        fileList.setLayoutOrientation(JList.VERTICAL_WRAP);
                        fileList.setVisible(true);
                        fileList.setVisibleRowCount(-1);
                        fileList.setSelectedIndex(0);
                        listScroller = new JScrollPane(fileList);
                        listScroller.setPreferredSize(new Dimension(200,200));
                        listScroller.setAlignmentX(LEFT_ALIGNMENT);
                        add(listScroller);
                        MouseListener mouseListener = new MouseAdapter(){
                             public void mouseClicked(MouseEvent e){
                                  if(e.getClickCount()==2){
                                       int itemIndex = fileList.locationToIndex(e.getPoint());
                                       currFile=fileArr[itemIndex];
                                       dispose();
                        fileList.addMouseListener(mouseListener);
                   public void actionPerformed(ActionEvent e){
                        if("SelectItem".equals(e.getActionCommand())){
                             currFile=(String)fileList.getSelectedValue();
                             dispose();
                        }else{
                        if("Cancel".equals(e.getActionCommand())){
                             dispose();
                        }else{
                        if("ChangeDirectory".equals(e.getActionCommand())){
                             ChangeDir cd = new ChangeDir("Select Directory");
                             cd.setSize(new Dimension(300,275));
                             cd.setLocation(500, 225);
              private class FolderListPanel extends JPanel{
                   public FolderListPanel(){
                        String[] files = dir.list();
                        DefaultMutableTreeNode topNode = new DefaultMutableTreeNode("Files");
                        folders = new DefaultMutableTreeNode("C:/");
                        topNode.add(folders);
                        folders = getFolders(dir, folders);
                        tree = new JTree(topNode);
                        tree.setVisible(true);
                        JScrollPane treeScroller = new JScrollPane(tree);
                        treeScroller.setPreferredSize(new Dimension(500,233));
                        treeScroller.setAlignmentX(LEFT_ALIGNMENT);
                        add(treeScroller);
                        MouseListener mouseListener = new MouseAdapter(){
                             public void mouseClicked(MouseEvent e){
                                  try{
                                       if(e.getClickCount()==1){
                                            selPath = tree.getPathForLocation(e.getX(), e.getY());
                                            path=selPath.getLastPathComponent().toString();
                                            dir = new File(path);
                                            TreeNode tn=findNode(folders, path);                    
                                            if(tn!=null){
                                                 folders.add((MutableTreeNode) getTreeNode(dir, (DefaultMutableTreeNode) tn));
                                            tree.updateUI();
                                            final String[] fileArr=dir.list();
                                            fileList = new JList(fileArr);
                                            fileList.updateUI();
                                            listScroller.updateUI();
                                            fileLP = new FileListPanel();
                                  }catch(NullPointerException npe){
                        tree.addMouseListener(mouseListener);
                   public DefaultMutableTreeNode getFolders(File dir, DefaultMutableTreeNode folders){
                        File[] folderList = dir.listFiles();
                        int check=0;
                        for(int x=0;x<folderList.length;x++){
                             if(folderList[x].isDirectory()){
                                  folders.add(new DefaultMutableTreeNode(folderList[x]));               
                        return folders;
                   public TreeNode getTreeNode(File dir, DefaultMutableTreeNode folders){
                        File[] folderList = dir.listFiles();
                        int check=0;
                        for(int x=0;x<folderList.length;x++){
                             if(folderList[x].isDirectory()){
                                  folders.add(new DefaultMutableTreeNode(folderList[x]));               
                        return folders;
                   public TreeNode findNode(DefaultMutableTreeNode folders, String node){
                        Enumeration children = folders.postorderEnumeration();
                        Object current;
                        while(children.hasMoreElements()){
                             current = children.nextElement();
                             if(current.toString().equals(node)){
                                  return (TreeNode)current;
                        return null;
         }

    Wow! I changed the FolderListPanel's mouseListener to:
    tree.addTreeSelectionListener(new TreeSelectionListener(){
                             public void valueChanged(TreeSelectionEvent tse){
                                  DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
                                  if(node==null)return;
                                  Object nodeInfo = node.getUserObject();
                                  dir=new File(nodeInfo.toString());
                                  folders.add((MutableTreeNode) getFolders(dir,node));
                        });and it's amazing how much better the tree is!!! But I still don't have the JList part working. I changed the JList and the FileListPanel to public from private, but that didn't change anything.

  • SharePoint 2010, Visual Studio 2010, Packaging a solution - The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Hi,
    I have a solution that used to contain one SharePoint 2010 project. The project is named along the following lines:
    <Company>.<Product>.SharePoint - let's call it Project1 for future reference. It contains a number of features which have been named according
    to their purpose, some are reasonably long and the paths fairly deep. As far as I am concerned we are using sensible namespaces and these reflect our company policy of "doing things properly".
    I first encountered the following error message when packaging the aforementioned SharePoint project into a wsp:
    "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."
    I went through a great deal of pain in trying to rename the project, shorten feature names and namespaces etc... until I got it working. I then went about gradually
    renaming everything until eventually I had what I started with, and it all worked. So I was none the wiser...not ideal, but I needed to get on and had tight delivery timelines.
    Recently we wanted to add another SharePoint project so that we could move some of our core functinality out into a separate SharePoint solution - e.g. custom workflow
    error logging. So we created another project in Visual Studio called:
    <Company>.<Product>.SharePoint.<Subsystem> - let's call it Project2 for future reference
    And this is when the error has come back and bitten me! The scenario is now as follows:
    1. project1 packages and deploys successfully with long feature names and deep paths.
    2. project2 does not package and has no features in it at all. The project2 name is 13 characters longer than project1
    I am convinced this is a bug with Visual Studio and/or the Package MSBuild target. Why? Let me explain my findings so far:
    1. By doing the following I can get project2 to package
    In Visual Studio 2010 show all files of project2, delete the obj, bin, pkg, pkgobj folders.
    Clean the solution
    Shut down Visual Studio 2010
    Open Visual Studio 2010
    Rebuild the solution
    Package the project2
    et voila the package is generated!
    This demonstrates that the package error message is in fact inaccurate and that it can create the package, it just needs a little help, since Visual Studio seems to
    no longer be hanging onto something.
    Clearly this is fine for a small time project, but try doing this in an environment where we use Continuous Integration, Unit Testing and automatic deployment of SharePoint
    solutions on a Build Server using automated builds.
    2. I have created another project3 which has a ludicrously long name, this packages fine and also has no features contained within it.
    3. I have looked at the length of the path under the pkg folder for project1 and it is large in comparison to the one that is generated for project2, that is when it
    does successfully package using the method outlined in 1. above. This is strange since project1 packages and project2 does not.
    4. If I attempt to add project2 to my command line build using MSBuild then it fails to package and when I then open up Visual Studio and attempt to package project2
    from the Visual Studio UI then it fails with the path too long error message, until I go through the steps outlined in 1. above to get it to package.
    5. DebugView shows nothing useful during the build and packaging of the project.
    6. The error seems to occur in
    CreateSharePointProjectService target called at line 365 of
    Microsoft.VisualStudio.SharePoint.targetsCurrently I am at a loss to work out why this is happening? My next task is to delete
    project2 completely and recreate it and introduce it into my Visual Studio solution.
    Microsoft, can you confirm whether this is a known issue and whether others have encountered this issue? Is it resolved in a hotfix?
    Anybody else, can you confirm whether you have come up with a solution to this issue? When I mean a solution I mean one that does not mean that I have to rename my namespaces,
    project etc... and is actually workable in a meaningful Visual Studio solution.

    Hi
    Yes, I thought I had fixed this my moving my solution from the usual documents  to
    c:\v2010\projectsOverflow\DetailedProjectTimeline
    This builds ok, but when I come to package I get the lovely error:
    Error 2 The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. C:\VS2010\ProjectsOverflow\DetailedProjectTimeline\VisualDetailedProjectTimelineWebPart\Features\Feature1\Feature1.feature VisualDetailedProjectTimeline
    Now, the error seems to be related to 
    Can anyone suggest what might be causing this. Probably some path in an XML file somewhere. Here is my prime suspect!
    <metaData>
    <type name="VisualDetailedProjectTimelineWebPart.VisualProjectTimelineWebPart.VisualProjectTimeline, $SharePoint.Project.AssemblyFullName$" />
    <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
    </metaData>
    <data>
    <properties>
    <property name="Title" type="string">VisualProjectTimelineWebPart</property>
    <property name="Description" type="string">My Visual WebPart</property>
    </properties>
    </data>
    </webPart>
    </webParts>
    .... Unless I can solve this I will have to remove the project and recreate but with simple paths. Tho I will be none the wiser if I come across this again.
    Daniel

  • Active Directory domain migration with Exchange 2010, System Center 2012 R2 and File Servers

    Greeting dear colleagues!
    I got a task to migrate existing Active Directory domain to a new froest and a brand new domain.
    I have a single domain with Forest/Domain level 2003 and two DC (2008 R2 and 2012 R2). My domain contains Exchange 2010 Organization, some System Center components (SCCM, SCOM, SCSM) and File Servers with mapped "My Documents" user folders. Domain
    has about 1500 users/computers.
    How do u think, is it realy possible to migrate such a domain to a new one with minimum downtime and user interruption? Maybe someone has already done something like that before? Please, write that here, i promise that i won't ask for instruction from you,
    maybe only some small questions :)
    Now I'm studying ADMT manual for sure.
    Thanks in advance, 
    Dmitriy Titov
    С уважением, Дмитрий Титов

    Hi Dmitriy,
    I got a task to migrate existing Active Directory domain to a new froest and a brand new domain.
    How do u think, is it realy possible to migrate such a domain to a new one with minimum downtime and user interruption?
    As far as I know, during inter-forest migration, user and group objects are cloned rather than migrated, which means they can still access resources in the source forest, they can even access resources after the migration is completed. You can ask users
    to switch domain as soon as the new domain is ready.
    Therefore, there shouldn’t be a huge downtime/interruption.
    More information for you:
    ADMT Guide: Migrating and Restructuring Active Directory Domains
    https://technet.microsoft.com/en-us/library/cc974332(v=ws.10).aspx
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]

  • Set default directory and file permissions

    I'm trying to use setfacl to set the default permissions for directories and files but I get an error saying "sudo: setfacl: command not found." What I am trying to do is share a specific directory on a local external drive connected by Thunderbolt. Everyone in the group has access to the drive and can view all the files but once a new file is created, the group permissions are not updated. Here is an example of two PDF file. The one created by userA only has permissions for that user where the file created by userB allows all users to open and modity the file.
    -rw-------   1 userA    staff   1988176 Feb 13 15:09 TestFile01.pdf
    -rwxr-----+  1 userB  staff   1827102 Feb 13 15:05 TestFile02.pdf
    0: group:MarketingGroup allow read,write,append,readattr,writeattr,readextattr,writeextattr,readsecurity
    I can manually update the permissions through the Get Info window but this requires me to reset permissions every time a person saves a new file to the drive. There needs to be a way to do this automatically.
    Here is what I tried but the setfacl command is not supported.
    sudo setfacl -Rdm g:GroupName:rwx /DirectoryPath

    Thanks Frank. I have an externat drive connected to my Mac via Thunderbolt. On this drive I have a specific directory that I'm shairing with Mac and PC users. I've created a group on the network to limit access to this directory to specific users. That works perfectly. The issue I'm having is when one of these users creates a new file in this directory or any of it's subdirectories, no one has permission to open or edit the file. Right now I'm using Get Info to modify the permissions of the folder and all enclosed items. When I check the permissions of the files I've "corrected" I notice this extra imformation "0: group:MarketingGroup allow read,write,append,readattr,writeattr,readextattr,writeextattr,readsecurity." This is not included when I check the permissions of items saved by other uses in the group.
    So my question is how do I set the default permissions for this directory so every new file and directory will have the correct permissions to allow anyone in this group full access to open and modify every file?
    Thanks for your help!!!!

  • Directory structure and files in Oracle Application server 10g and 11g

    Hi all,
    I am doing a lab migration from 10g to 11g based on the use of JAXB. There were some directory structures used in 10g to store the JAXB jar files and some other custom jar files. I want to know the equivalent folder structures in SOA 11g server. The 10g server directories are mentioned below:-
    1.<OracleAS_Home>\webservices\lib.
    2. server.xml located at <OracleAS_Home>\j2ee\home\config in 10g. Where can I find the equivalent file to "server.xml" in 11g server?
    3. <OracleAS_Home>\bpel\system\classes\com\oracle\bpel\xml\util.
    4. <OracleAS_Home> \bpel\system\classes.

    Here are the equivalents as per best of my knowledge:
    1. <WebLogic Home>\server\lib
    For example, D:\Middleware\wls1036\wlserver_10.3\server\lib
    2. config,xml located at <Domain_Home>\config\
    For example, D:\Middleware\wls1036\user_projects\domains\ArunBaseDomain1036\config\config.xml
    3. It should be the same as 10g (instead of OracleAS_Home, it will be ORACLE_Home) if you install the BPEL product. Since, I have not installed BPEL/SOA, I am not very sure.
    4. It should be the same as 10g (instead of OracleAS_Home, it will be ORACLE_Home) if you installed the BPEL product.
    Also, I would recommend that you consider using ORACLE Smart Upgrade (JDeveloper component) to help you with the upgrade process. It exactly points out these mappings of file/directory structures AND the necessary configuration changes as well.
    If you are requirement, is only about making the library jars available to your application, then consider reading the below discussion.
    Re: XIncludeAwareParserConfiguration cannot be cast to XMLParserConfiguration
    Arun

  • How can I get Directory and Files from a Maped Networkdrive of the AppS

    Hello,
    we have the following Situation.
    We have a Windows-Server (Server-A) in an Network with ActivDirectory and an Windows-Server (Server-B with an WebApplicationServer outside of these ActivDirectory as standalone.
    On Server-B we mapped a Directory from Server-A (FileExplorer and then MapNetworkDrives) as Drive Q.
    Now i tried to get the Directory of Q:\abcd but it doesn't work.
    I tried the FM EPS_GET_DIRECTORY_LISTING and also RZL_READ_DIR, but both doesn't worked.
    RZL_READ_DIR is doing a "CALL 'ALERTS' ..." and is comming back with sy-subrc = 1
    EPS_GET_DIRECTORY_LISTING is doing a "CALL 'C_DIR_READ_FINISH'..." and comes back with "Wrong order of calls" in the Field file-errmsg. Next Call is "CALL 'C_DIR_READ_START'..." and this comes back with "opendir" in Field file-errmsg.
    I tried the same with two Servers in the same ActivDirectory-Network. The Result was the same, i don't get the directory of the mapped drive. But now i get from the Call "CALL 'C_DIR_READ_START'..." the file-errmsg "opendir: Not a directory" and file-errno 20.
    Is there any idea for solving my Problem?
    I have to get this directory, read the files from the List and have to rename them after wriing the data to our databasefile.
    I want to read them with OPEN DATASET, rename them by writing a new File (also OPEN DATASET) and after that i do an DELETE DATASET.
    Thanks and Greetings Matthias
    Edited by: Matthias Horstmann on Mar 25, 2009 4:12 PM
    Filled in Scenario with 2 Servers in same AD-Network

    Halo Mattias,
    i using this function get file file name and directory:
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
        exporting
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        importing
          file_name     = p_file.
    Rgds,
    Wilibrodus

  • Where did my file directory go?  I thought my mail was backed up in my .me account and now that my computer was stolen and I need to restore my emails all I can find are the ones in my inbox

    I thought my mail was backed up in my .me account but when my computer was stolen and I went to restore my email in my new one, all I had were emails in the inbox.  Is there any way I can retrieve the saved file directory?  I did not back up the mail because that was being done by the .me account (I thought)

    If her data was not backed up or synced to something, it's gone. Sorry.

  • Dynamic directory and file name

    Hi
    I have requirement of dynamic file name and dynamic directory with condition based on doctype from source
    I have used the following code and for file and directory with two different udfs. If I am using only file it is working but not with the directory
    try
    String directory = new String("");
    DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");
      if (var1.equals( "DOR" ))
       directory =   "/Inbound/DOR";
       else {
       directory =   "/Inbound/KOR";
         conf1.put(key1,directory);
         return directory ;
         catch(Exception e)
           String Exception=e.toString();
          return Exception;
    in message mapping i used var1 to one of the not used field in target
    similary i did for file  with different udf and mapped sourcefield- to targetrootnode with same condition with different filename
    But it is not working getting the following exception Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote://*/PACK _TEST20140226-152149-483.dat", so it contains the character "remote://*/PACK _TEST20140226-152149-483.dat" which is not allowed
    Thanks for your help

    Hi Mahesh -
    The parameter "argument" has the value "remote://*/PACK _TEST20140226-152149-483.dat", so it contains the character "remote://*/PACK _TEST20140226-152149-483.dat" which is not allowed
    >>> I see that paramter name as "argument" in the above error. So you mean to say when you simply use the UDF just for file name it works for the above input.
    But the same udf fails if you enable another UDF for the directory? having the same payload?
    Is my understanding correct.
    However i would suggest you to have a one UDF for both "directory" and "Filename" and map the field to Target message type but not to any of the fields..

  • Accessing file directory objects in 9.1 and /WEB-INF/classes zip

    It appears that in WebLogic 9.1 that the contents of the /WEB-INF/classes directory is being zipped up and placed in the /WEB-INF/lib directory under some arbitrary name.
    Is there a way to tell weblogic not to do this, but leave the /WEB-INF/classes directory expanded as it was in weblogic 8?
    Is there a particular reason, developers should be aware of, to why this is being done in 9.1 (9.x?)?
    Background :
    This particular app has a set of several hundred xml files that describe all of the screens (and thus the forms) of the app. They are used not only in the generation of the actual jsps (and believe it or not the action class as well as other supporting class, the app is really an interface to a legacy backend) but are also packaged within the WAR for the dynamic configuration of plugins used for complex validation; a quasi 'rules' engine.
    While there are several different versions of the app, and thus several different versions of xml files, there is only one version of the rules engine.
    The problem that has arised when running on 9.1 is the plugins access to those xml files.
    The plugin attempts to load the xml files by creating File object for the directory containing the xml files, and then iterating through the contents of that directory.
    The xml files are packaged within the /WEB-INF/classes directory and are thus accessible using a simple resource look-up (in actuality, a 'token' xml file is specified, looked-up as a resource and then used to determine the parent file directory's url).
    This has worked well enough as 'most' servers deploy the contents of /WEB-INF/classes directory in an expandable fashion. Obviously, this strategy readly breaks when those same contents are jar'd and placed in the /lib directory.
    It is prefered to not have to maintain a cataloge or index of the xml files because of the volume of xml files, the multiple versions of the xml files, and of course the volitility of the xml files, although this is an obvious option.
    I personally have mixed feelings about using a parent directory reference to load a set of resource files within a j2ee app. If anyone has any other suggestions, I would greatly appreciate it!
    Thanks
    Andrew

    Hi,
    Usually, the best approach would be to just to load the resources as InputStream and have a catalog (and I know this is what you do not want to do :-) So the only hacky workaround that I can think of would be to use something like Jakarta Commons Virtual File System (http://jakarta.apache.org/commons/vfs/) and read the .zip
    Regards,
    LG

  • How to install an entire directory structure and files with the LabVIEW installer

    I think I may be missing something on how to do this - preserve a file directory structure in the LabVIEW build process.
    Is there an easy way to distribute an entire directory structure (multiple directory levels/text files) and have the LabVIEW build process properly preserve and install them?   I included a directory in my build specification but it completely flattened the file structure and then so when the installer builds it, the resulting structure in the /data directory is flattened as well.    I'd prefer not to go through each file (~100) and setup a specific target location.   Is there an easy way to preserve the file structure in the build process/installer process that I am missing (maybe a check box that I didn't see or an option setting somewhere)?
    -DC

    Hi DC
    Sorry for the delay in responding to your question.
    You should be able to do this using a 'Source Distribution' as described below:
     - Right click on 'Build Specifications' and select 'New' - 'Source Distribution'
     - Provide a name
     - Add your files to 'Always included' under 'Source Files'
     - Under 'Destinations' select 'Preserve disk hierarchy' and ensure that 'Directory' is selected as the 'Destination type'
    When building an installer your can then choose to include your source distribution and it will be installed to a location of your choosing.
    Hope this helps.
    Kind Regards
    Chris | Applications Engineer NIUK

Maybe you are looking for

  • Commision Agent

    please suggest me how to customise/configure commision agent in SAP.

  • Lenovo G550 and Sagem Fast 800 ADSL modem - limits DL speed to approx. 500kbit/s

    Hi, I bought Lenovo G550 on Tuesday and since then I've got a strange issue with my Internet connection. Until Tuesday I was using Sagem Fast 800 ADSL modem from my ISP on Toshiba Satellite A100-712 notebook since June 2008 with 1Mbit connection and

  • Why is shipping @ Lenovo so slow and disorganized???

    I just wanted to relate a story about a purchase I tried to make thru the Lenovo Site. We needed a new portable workstation for off site programming for one of our service techs. I had heard good things about the new Lenovo computers and I wanted to

  • Any success with DVD playback?

    Has anyone gotten a java application or applet to playback a dvd? I mean a commercial dvd, not a data dvd with video burned on it. If so, how did you do it? What libraries? libdvdread/libdvdcss/libdvdplay?

  • External copy in java

    I want to copy the content of a directory to another one, with the external copy command on a UNIX system Process p = Runtime.getRuntime().exec("cp " + f1 + " " + f2); So far it works with single files. But it doens't work with "*.*". The same comman