Add a resource to this plugin.

@param path Resource path
@param type Resource type
421084
public final void addResource(String path, HtmlResourceType type) {
		resources.add(new HtmlResource(path, type));
	}
685733
protected void addLinkedResources(String path, GeneratorContext context) {
		List<Locale> locales = new ArrayList<>();
		Locale currentLocale = context.getLocale();
		if (currentLocale != null) {
			locales.add(currentLocale);
			if (StringUtils.isNotEmpty(currentLocale.getVariant())) {
				locales.add(new Locale(currentLocale.getCountry(), currentLocale.getLanguage()));
			}
			if (StringUtils.isNotEmpty(currentLocale.getLanguage())) {
				locales.add(new Locale(currentLocale.getCountry()));
			}
		}

		// Adds fallback locale
		locales.add(control.getFallbackLocale());
		Locale baseLocale = new Locale("", "");
		if (!locales.contains(baseLocale)) {
			locales.add(baseLocale);
		}

		List<FilePathMapping> fMappings = getFileMappings(path, context, locales);
		addLinkedResources(path, context, fMappings);

	}
180230
public void addType(String resourceType) {

        m_searchObject.addType(resourceType);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
93502
public void addPath(String path) {
        if (path == null) {
            return;
        }
        String[] pathComponents = path.split("/");
        TrieNode parent = rootNode;
        String part = null;
        if (pathComponents.length <= 1) {
            throw new IllegalArgumentException("Invalid path " + path);
        }
        for (int i=1; i<pathComponents.length; i++) {
            part = pathComponents[i];
            if (parent.getChild(part) == null) {
                parent.addChild(part, new TrieNode(parent));
            }
            parent = parent.getChild(part);
        }
        parent.setProperty(true);
    }
785714
public void addFile(String path, InputStream inputStream, String contentType) throws IOException {
    String fullPath = buildJcrPathForZip(path);
    writeBinaryFile(fullPath, inputStream);

    if (StringUtils.isNotEmpty(contentType)) {
      String mimeType = StringUtils.substringBefore(contentType, CONTENT_TYPE_CHARSET_EXTENSION);
      String encoding = StringUtils.substringAfter(contentType, CONTENT_TYPE_CHARSET_EXTENSION);

      String fullPathMetadata = fullPath + DOT_DIR_FOLDER + "/" + DOT_CONTENT_XML;
      Document doc = xmlContentBuilder.buildNtFile(mimeType, encoding);
      writeXmlDocument(fullPathMetadata, doc);
    }
  }
665401
public function add_path($path, $type = null)
	{
		is_null($type) and $type = $this->_path_folders;
		empty($path) and $path = DOCROOT;

		if( is_array($type))
		{
			foreach ($type as $key => $folder)
			{
				is_numeric($key) and $key = $folder;
				$folder = $this->_unify_path($path).ltrim($this->_unify_path($folder),DS);
				array_unshift($this->_asset_paths[$key], $folder);
			}
		}
		else
		{
			// create the asset type if it doesn't exist
			if ( ! isset($this->_asset_paths[$type]))
			{
				$this->_asset_paths[$type] = array();
				$this->_path_folders[$type] = $type.'/';
			}

			$path = $this->_unify_path($path);
			array_unshift($this->_asset_paths[$type], $path);
		}
		return $this;
	}
507743
private void addPaths(Path p) {

        for (String d : p.list()) {
            File dir = new File(d);
            if (dir.exists() && dir.isDirectory()) {
                if (!includeDirectories.contains(dir))
                    includeDirectories.add(dir);
            }
        }
    }
1228721
public void addClasspath(final String path) {
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
            public Void run() {

                URI newURI;
                try {
                    newURI = new URI(path);
                    // check if we can create a URL from that URI
                    newURI.toURL();
                } catch (URISyntaxException | IllegalArgumentException | MalformedURLException e) {
                    // the URI has a false format, so lets try it with files ...
                    newURI=new File(path).toURI();
                }

                URL[] urls = getURLs();
                for (URL url : urls) {
                    // Do not use URL.equals.  It uses the network to resolve names and compares ip addresses!
                    // That is a violation of RFC and just plain evil.
                    // http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html
                    // http://docs.oracle.com/javase/7/docs/api/java/net/URL.html#equals(java.lang.Object)
                    // "Since hosts comparison requires name resolution, this operation is a blocking operation.
                    // Note: The defined behavior for equals is known to be inconsistent with virtual hosting in HTTP."
                    try {
                        if (newURI.equals(url.toURI())) return null;
                    } catch (URISyntaxException e) {
                        // fail fast! if we got a malformed URI the Classloader has to tell it
                        throw new RuntimeException( e );
                    }
                }
                try {
                    addURL(newURI.toURL());
                } catch (MalformedURLException e) {
                    // fail fast! if we got a malformed URL the Classloader has to tell it
                    throw new RuntimeException( e );
                }
                return null;
            }
        });
    }
273274
public void addFile(String path, File file, String contentType) throws IOException {
    try (InputStream is = new FileInputStream(file)) {
      addFile(path, is, contentType);
    }
  }
1346256
def addDesktopResource(self, pluginSubPath: bytes, resource: BasicResource) -> None:
        
        pluginSubPath = pluginSubPath.strip(b'/')
        self.__rootDesktopResource.putChild(pluginSubPath, resource)
321916
public void addImplements(String type) {
		if (!Strings.isEmpty(type)) {
			this.sarlClass.getImplements().add(newTypeRef(this.container, type));
		}
	}
1170203
public void setTreeResource(String type, String value) {

        if (value == null) {
            return;
        }
        if (value.startsWith(CmsResource.VFS_FOLDER_SYSTEM + "/") && (!value.startsWith(m_currentSite))) {
            // restrict access to /system/
            value = "/";
        }
        m_treeType.put(type, value);
    }
890280
def add(self, path):
        
        if not isinstance(path, str) and not isinstance(path, unicode):
            raise TypeError('The value passed for parameter path is not a str'
                            ' or unicode')

        resource = Resource(path)
        self.resources[path] = resource
        return resource
525691
protected void addLinkedResources(String path, GeneratorContext context, List<FilePathMapping> fMappings) {
		linkedResourceMap.put(getResourceCacheKey(path, context), new CopyOnWriteArrayList<>(fMappings));
		JoinableResourceBundle bundle = context.getBundle();
		if (bundle != null) {

			List<FilePathMapping> bundleFMappings = bundle.getLinkedFilePathMappings();
			for (FilePathMapping fMapping : fMappings) {
				FilePathMapping fm = new FilePathMapping(bundle, fMapping.getPath(), fMapping.getLastModified());
				if (!bundleFMappings.contains(fm)) {
					bundleFMappings.add(fm);
				}
			}
		}

	}
775534
public void add(Object source) {
		if(source instanceof InputStream) {
			add((InputStream)source);
		} else if(source instanceof URL) {
			add((URL)source);
		} else if(source instanceof String) {
			add((String)source);
		} else {
			throw new JclException("Unknown Resource type");
		}

	}
527387
public static FtpMessage put(String localPath, DataType type) {
        return put(localPath, FileUtils.getFileResource(localPath).getFilename(), type);
    }
960125
def addMobileResource(self, pluginSubPath: bytes, resource: BasicResource) -> None:
        
        pluginSubPath = pluginSubPath.strip(b'/')
        self.__rootMobileResource.putChild(pluginSubPath, resource)