Retrieves a list of all mounted file systems (or drives on Windows) in
a platform-independent fashion.

@param
the types of file systems to retrieve; only applicable on UNIX machines.
@return
the list of mounted file systems.
552560
public static List<File> listAll(String ... fstypes) {
		
		List<File> drives = null; 
		switch(Platform.getCurrent()) {
		case WINDOWS_32:
		case WINDOWS_64:
			drives = listWindowsFileSystems();
			break;
		case LINUX_32:
		case LINUX_64:
		case UNIX_32:
		case UNIX_64:
			try {
				drives = listUnixFileSystems(fstypes);
			} catch (IOException e) {
				logger.error("error launching external mount command", e);
			}
			break;
		default:
			// TODO: what shall we do with MacOS-X? Is it a UNIX flavour in this respect?
			logger.error("unsupported platform: '{}'", Platform.getCurrent());
			break;
		}
		
		return drives;
	}
444992
public java.util.List<String> getPlatformTypes() {
        if (platformTypes == null) {
            platformTypes = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return platformTypes;
    }
1055135
public List<MountPointInfo> getMountPoints() {
        List<MountPointInfo> mountPoints = new ArrayList<MountPointInfo>();
        mountPoints.add(new MountPointInfo() {

            public String getPath() {
                return "manuallymounted";
            }

            public Class<? extends Page> getPage() {
                return ManuallyMountedPage.class;
            }
        });
        return mountPoints;
    }
822347
public List<GitlabSystemHook> getSystemHooks() throws IOException {
        String tailUrl = GitlabSystemHook.URL;
        return Arrays.asList(retrieve().to(tailUrl, GitlabSystemHook[].class));
    }
1134522
def EnumerateFilesystemsFromClient(args):
  """"""
  del args  # Unused.

  filenames = ["/proc/mounts", "/etc/mtab"]

  for filename in filenames:
    for device, fs_type, mnt_point in CheckMounts(filename):
      yield rdf_client_fs.Filesystem(
          mount_point=mnt_point, type=fs_type, device=device)
474947
public String listStorageDirectories() {
    StringBuffer buf = new StringBuffer();
    for (StorageDirectory sd : storageDirs) {
      buf.append(sd.getRoot() + "(" + sd.getStorageDirType() + ");");
    }
    return buf.toString();
  }
687572
public List<String> getLogicalDrives() {
		int flags = getLogicalDrives0();
		
		List<String> letters = new ArrayList<String>();
		for (int i = 0; i < 26; i++) {
			if ((flags & (1 << i)) != 0) letters.add(Character.toString((char)('A' + i)));
		}
		
		return letters;
	}
1127127
def _get_filesystem_config(file_types):
    
    out = "     filesystems {\n"
    for file_type in sorted(list(file_types)):
        if file_type in _FILESYSTEM_CONFIG:
            out += _FILESYSTEM_CONFIG[file_type]
    out += "      }\n"
    return out
906958
private Map<String, Long> listFiles() throws FtpException {
		int attempts = 0;
		Map<String, Long> files = new LinkedHashMap<String, Long>();
		while (true){
			try {
				FTPListParseEngine engine = null;
				if (type.startsWith("UNIX")) {
					engine = ftpClient.initiateListParsing(FTPClientConfig.SYST_UNIX, null);
				} else {
					engine = ftpClient.initiateListParsing();
				}

				FTPFile[] list = engine.getFiles();
				if (list != null){
					for (FTPFile ftpFile : list){
						files.put(ftpFile.getName(), ftpFile.getSize());
					}
				}
				return files;
			} catch (Exception e) {
				attempts++;
				if (attempts > 3) {
					throw new FtpListFilesException(e);
				} else {
					LOGGER.trace("First attempt to get list of files FAILED! attempt={}", attempts);
				}
			}
		}
	}
898778
def mounts():
    """"""
    with open('/proc/mounts') as f:
        # [['/mount/point','/dev/path'],[...]]
        system_mounts = [m[1::-1] for m in [l.strip().split()
                                            for l in f.readlines()]]
    return system_mounts
1242465
public java.util.List<SMBFileShareInfo> getSMBFileShareInfoList() {
        if (sMBFileShareInfoList == null) {
            sMBFileShareInfoList = new com.amazonaws.internal.SdkInternalList<SMBFileShareInfo>();
        }
        return sMBFileShareInfoList;
    }
709404
public static List<StorageInfo> getStorageList() {

        List<StorageInfo> list = new ArrayList<StorageInfo>();
        String def_path = "";
        boolean def_path_internal = false;
        String def_path_state = "";
        boolean def_path_readonly = true;
        boolean def_path_available = false;
        try {
            if (Environment.getExternalStorageDirectory() != null) {
                def_path = Environment.getExternalStorageDirectory().getPath();
            }
        } catch (Throwable ex) {
            //trap for android studio layout editor and some for certain devices
            //see https://github.com/osmdroid/osmdroid/issues/508
            ex.printStackTrace();
        }
        try {
            def_path_internal = (Build.VERSION.SDK_INT >= 9) && !Environment.isExternalStorageRemovable();
        } catch (Throwable ex) {
            //trap for android studio layout editor and some for certain devices
            //see https://github.com/osmdroid/osmdroid/issues/508
            ex.printStackTrace();
        }
        try {
            def_path_state = Environment.getExternalStorageState();
        } catch (Throwable ex) {
            //trap for android studio layout editor and some for certain devices
            //see https://github.com/osmdroid/osmdroid/issues/508
            ex.printStackTrace();
        }
        try {
            def_path_available = def_path_state.equals(Environment.MEDIA_MOUNTED) || def_path_state.equals(Environment.MEDIA_MOUNTED_READ_ONLY);
        } catch (Throwable ex) {
            //trap for android studio layout editor and some for certain devices
            //see https://github.com/osmdroid/osmdroid/issues/508
            ex.printStackTrace();
        }

        try {
            def_path_readonly = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED_READ_ONLY);
        } catch (Throwable ex) {
            //trap for android studio layout editor and some for certain devices
            //see https://github.com/osmdroid/osmdroid/issues/508
            ex.printStackTrace();
        }
        BufferedReader buf_reader = null;
        try {
            HashSet<String> paths = new HashSet<String>();
            buf_reader = new BufferedReader(new FileReader("/proc/mounts"));
            String line;
            int cur_display_number = 1;
            Log.d(TAG, "/proc/mounts");
            while ((line = buf_reader.readLine()) != null) {
                Log.d(TAG, line);
                if (line.contains("vfat") || line.contains("/mnt")) {
                    StringTokenizer tokens = new StringTokenizer(line, " ");
                    String unused = tokens.nextToken(); //device
                    String mount_point = tokens.nextToken(); //mount point
                    if (paths.contains(mount_point)) {
                        continue;
                    }
                    unused = tokens.nextToken(); //file system
                    List<String> flags = Arrays.asList(tokens.nextToken().split(",")); //flags
                    boolean readonly = flags.contains("ro");

                    if (mount_point.equals(def_path)) {
                        paths.add(def_path);
                        list.add(0, new StorageInfo(def_path, def_path_internal, readonly, -1));
                    } else if (line.contains("/dev/block/vold")) {
                        if (!line.contains("/mnt/secure")
                            && !line.contains("/mnt/asec")
                            && !line.contains("/mnt/obb")
                            && !line.contains("/dev/mapper")
                            && !line.contains("tmpfs")) {
                            paths.add(mount_point);
                            // if (isWritable(new File(mount_point+ File.separator)))
                            list.add(new StorageInfo(mount_point, false, readonly, cur_display_number++));
                        }
                    }
                }
            }

            if (!paths.contains(def_path) && def_path_available && def_path.length() > 0) {
                list.add(0, new StorageInfo(def_path, def_path_internal, def_path_readonly, -1));
            }

        } catch (FileNotFoundException ex) {
            ex.printStackTrace();
        } catch (IOException ex) {
            ex.printStackTrace();
        } finally {
            if (buf_reader != null) {
                try {
                    buf_reader.close();
                } catch (IOException ex) {
                }
            }
        }
        Set<File> allStorageLocationsRevised = getAllStorageLocationsRevised();
        Iterator<File> iterator = allStorageLocationsRevised.iterator();
        while (iterator.hasNext()) {
            File next = iterator.next();
            boolean found = false;
            for (int i = 0; i < list.size(); i++) {
                if (list.get(i).path.equals(next.getAbsolutePath())) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                list.add(new StorageInfo(next.getAbsolutePath(), false, false, -1));
            }
        }


        return list;
    }
664758
public static List getClasspathDirectories()
    {
        List directories = new ArrayList();
        List components = getClasspathComponents();
        for (Iterator i = components.iterator(); i.hasNext();)
        {
            String possibleDir = (String) i.next();
            File file = new File(possibleDir);
            if (file.isDirectory())
            {
                directories.add(possibleDir);
            }
        }
        List tomcatPaths = getTomcatPaths();
        if (tomcatPaths != null)
        {
            directories.addAll(tomcatPaths);
        }
        return directories;
    }
511894
public java.util.List<String> getPartitions() {
        if (partitions == null) {
            partitions = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return partitions;
    }
685819
def GetFileSystems():
  
  version = OSXVersion()
  major, minor = version.VersionAsMajorMinor()

  libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("c"))

  if major <= 10 and minor <= 5:
    use_64 = False
    fs_struct = StatFSStruct
  else:
    use_64 = True
    fs_struct = StatFS64Struct

  # Get max 20 file systems.
  struct_size = fs_struct.GetSize()
  buf_size = struct_size * 20

  cbuf = ctypes.create_string_buffer(buf_size)

  if use_64:
    # MNT_NOWAIT = 2 - don't ask the filesystems, just return cache.
    ret = libc.getfsstat64(ctypes.byref(cbuf), buf_size, 2)
  else:
    ret = libc.getfsstat(ctypes.byref(cbuf), buf_size, 2)

  if ret == 0:
    logging.debug("getfsstat failed err: %s", ret)
    return []
  return ParseFileSystemsStruct(fs_struct, ret, cbuf)
853102
public String getFileSystemTypeLabel() {
        final StringBuilder sb = new StringBuilder(FILE_SYSTEM_TYPE_LENGTH);

        for (int i=0; i < FILE_SYSTEM_TYPE_LENGTH; i++) {
            sb.append ((char) get8(getFileSystemTypeLabelOffset() + i));
        }

        return sb.toString();
    }
1359671
def get_files_types(self):
        
        for i in self.get_files():
            buffer = self.zip.read(i)
            self.files_crc32[i] = crc32(buffer)
            self.files[i] = "Unknown"
        return self.files