public boolean publishShpCollection(String workspace, String storeName, URI resource)
            throws FileNotFoundException {

        // Deduce upload method & mime type from resource syntax.
        UploadMethod method = null;
        String mime = null;
        if (resource.getScheme().equals("file") || resource.isAbsolute() == false) {
            File f = new File(resource);
            if (f.exists() && f.isFile() && f.toString().endsWith(".zip")) {
                method = UploadMethod.FILE;
                mime = "application/zip";
            } else if (f.isDirectory()) {
                method = UploadMethod.EXTERNAL;
                mime = "text/plain";
            }
        } else {
            try {
                if (resource.toURL() != null) {
                    method = UploadMethod.URL;
                    mime = "text/plain";
                }
            } catch (MalformedURLException e) {
                throw new IllegalArgumentException(
                        "Resource is not recognized as a zip file, or a directory, or a valid URL",
                        e);
            }
        }

        // Create store, upload data, and publish layers
        return createStore(workspace, StoreType.DATASTORES, storeName, method,
                DataStoreExtension.SHP, mime, resource, ParameterConfigure.ALL,
                new NameValuePair[0]);
    }