Ejemplo n.º 1
0
        /// show all folders of a server and if there are mounted

        /**
         *
         * @return  if any folder is not mounted or mounting
         * it will return unmounted, else mounted
         */
        public static Sshfs.DriveStatus status_complete_server()
        {
            ServerModel server;

            Sshfs.DriveStatus return_value = Sshfs.DriveStatus.Mounted;

            try
            {
                Init();

                server = name2server(fissh_command_expression.parameter_servername.get());

                foreach (FolderModel i in server.Folders)
                {
                    if (i.Status != Sshfs.DriveStatus.Mounted && i.Status != Sshfs.DriveStatus.Mounting)
                    {
                        return_value = Sshfs.DriveStatus.Unmounted;
                    }
                    fissh_print.simple_output_message("Folder " + i.Name + " is " + i.Status.ToString() + ".");
                }
                return(return_value);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 2
0
        /// shows if the given folders are mounted or not

        /**
         *
         * @return  if any folder is not mounted or mounting
         * it will return unmounted, else mounted
         */
        public static Sshfs.DriveStatus status_registered_folders()
        {
            ServerModel        server;
            List <FolderModel> folders      = new List <FolderModel>();
            List <string>      folder_names = new List <string>();

            Sshfs.DriveStatus return_value = Sshfs.DriveStatus.Mounted;


            try
            {
                Init();

                server       = name2server(fissh_command_expression.parameter_servername.get());
                folder_names = fissh_command_expression.parameter_folderlist.get().Split(',').ToList();

                foreach (string i in folder_names)
                {
                    folders.Add(name2folder(server, i));
                }

                foreach (FolderModel i in folders)
                {
                    if (i.Status != Sshfs.DriveStatus.Mounted && i.Status != Sshfs.DriveStatus.Mounting)
                    {
                        return_value = Sshfs.DriveStatus.Unmounted;
                    }
                    fissh_print.simple_output_message("Folder " + i.Name + " is " + i.Status.ToString() + ".");
                }
                return(return_value);
            }
            catch (Exception e)
            {
                throw e;
            }
        }