ListSegments() public method

public ListSegments ( ) : void
return void
Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                // LUCENENET specific - our wrapper console shows the correct usage
                throw new ArgumentException();
                //Console.Error.WriteLine("Usage: IndexSplitter <srcDir> -l (list the segments and their sizes)");
                //Console.Error.WriteLine("IndexSplitter <srcDir> <destDir> <segments>+");
                //Console.Error.WriteLine("IndexSplitter <srcDir> -d (delete the following segments)");
                //return;
            }
            DirectoryInfo srcDir = new DirectoryInfo(args[0]);
            IndexSplitter @is    = new IndexSplitter(srcDir);

            if (!srcDir.Exists)
            {
                throw new Exception("srcdir:" + srcDir.FullName + " doesn't exist");
            }
            if (args[1].Equals("-l", StringComparison.Ordinal))
            {
                @is.ListSegments();
            }
            else if (args[1].Equals("-d", StringComparison.Ordinal))
            {
                IList <string> segs = new List <string>();
                for (int x = 2; x < args.Length; x++)
                {
                    segs.Add(args[x]);
                }
                @is.Remove(segs);
            }
            else
            {
                DirectoryInfo  targetDir = new DirectoryInfo(args[1]);
                IList <string> segs      = new List <string>();
                for (int x = 2; x < args.Length; x++)
                {
                    segs.Add(args[x]);
                }
                @is.Split(targetDir, segs);
            }
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                Console.Error.WriteLine("Usage: IndexSplitter <srcDir> -l (list the segments and their sizes)");
                Console.Error.WriteLine("IndexSplitter <srcDir> <destDir> <segments>+");
                Console.Error.WriteLine("IndexSplitter <srcDir> -d (delete the following segments)");
                return;
            }
            DirectoryInfo srcDir = new DirectoryInfo(args[0]);
            IndexSplitter @is    = new IndexSplitter(srcDir);

            if (!srcDir.Exists)
            {
                throw new Exception("srcdir:" + srcDir.FullName + " doesn't exist");
            }
            if (args[1].Equals("-l"))
            {
                @is.ListSegments();
            }
            else if (args[1].Equals("-d"))
            {
                IList <string> segs = new List <string>();
                for (int x = 2; x < args.Length; x++)
                {
                    segs.Add(args[x]);
                }
                @is.Remove(segs.ToArray());
            }
            else
            {
                DirectoryInfo  targetDir = new DirectoryInfo(args[1]);
                IList <string> segs      = new List <string>();
                for (int x = 2; x < args.Length; x++)
                {
                    segs.Add(args[x]);
                }
                @is.Split(targetDir, segs.ToArray());
            }
        }
Ejemplo n.º 3
0
 public static void Main(string[] args)
 {
     if (args.Length < 2)
     {
         Console.Error.WriteLine("Usage: IndexSplitter <srcDir> -l (list the segments and their sizes)");
         Console.Error.WriteLine("IndexSplitter <srcDir> <destDir> <segments>+");
         Console.Error.WriteLine("IndexSplitter <srcDir> -d (delete the following segments)");
         return;
     }
     DirectoryInfo srcDir = new DirectoryInfo(args[0]);
     IndexSplitter @is = new IndexSplitter(srcDir);
     if (!srcDir.Exists)
     {
         throw new Exception("srcdir:" + srcDir.FullName + " doesn't exist");
     }
     if (args[1].Equals("-l"))
     {
         @is.ListSegments();
     }
     else if (args[1].Equals("-d"))
     {
         IList<string> segs = new List<string>();
         for (int x = 2; x < args.Length; x++)
         {
             segs.Add(args[x]);
         }
         @is.Remove(segs.ToArray());
     }
     else
     {
         DirectoryInfo targetDir = new DirectoryInfo(args[1]);
         IList<string> segs = new List<string>();
         for (int x = 2; x < args.Length; x++)
         {
             segs.Add(args[x]);
         }
         @is.Split(targetDir, segs.ToArray());
     }
 }