/* --- Public methods ---
492843
public static String toJava(String regex) {
        if (StringUtils.isBlank(regex)) {
            return regex;
        } else {
            return regex.replaceAll("\\.", "\\\\.")
                    .replaceAll("\\*",".*");
        }
    }
926866
@Override
    public <V extends FileAttributeView> V getFileAttributeView(final Path path, final Class<V> type,
        final LinkOption... options) {
        if (path == null) {
            throw new IllegalArgumentException("path must be specified");
        }
        if (type == null) {
            throw new IllegalArgumentException("type must be specified");
        }
        if (!type.isAssignableFrom(ShrinkWrapFileAttributeView.class)) {
            // Nope, we don't support this view
            return null;
        }
        if (!(path instanceof ShrinkWrapPath)) {
            throw new IllegalArgumentException("Only " + ShrinkWrapPath.class.getSimpleName() + " is supported");
        }
        return type.cast(new ShrinkWrapFileAttributeView(new ShrinkWrapFileAttributes((ShrinkWrapPath) path,
                getArchive(path))));
    }
1215228
private static void init() {
        String pkgs = System.getProperty("java.protocol.handler.pkgs");
        if (pkgs == null || pkgs.trim().length() == 0) {
            pkgs = "org.jboss.net.protocol|org.jboss.vfs.protocol";
            System.setProperty("java.protocol.handler.pkgs", pkgs);
        } else if (pkgs.contains("org.jboss.vfs.protocol") == false) {
            if (pkgs.contains("org.jboss.net.protocol") == false) { pkgs += "|org.jboss.net.protocol"; }
            pkgs += "|org.jboss.vfs.protocol";
            System.setProperty("java.protocol.handler.pkgs", pkgs);
        }
    }
669617
public void update(CmsEntity entity) {

        List<Object> baseObjects = CmsEntity.getValuesForPath(entity, m_basePath);
        LinkedHashMap<String, String> options = Maps.newLinkedHashMap();
        for (Object baseObject : baseObjects) {
            List<Object> valueValues = CmsEntity.getValuesForPath(baseObject, m_valuePath);
            List<Object> descriptionValues = CmsEntity.getValuesForPath(baseObject, m_descriptionPath);
            if (valueValues.size() > 0) {
                String value = (String)valueValues.get(0);
                String description = value;
                if (descriptionValues.size() > 0) {
                    description = (String)descriptionValues.get(0);
                }
                options.put(value, description);
            }
        }
        replaceOptions(options);
    }
1141559
public void setAttributes(java.util.Collection<AttributeType> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<AttributeType>(attributes);
    }
156367
@Override
    public synchronized void onFileCreate(File file) {
        final Set<DetectedWebJar> listOfDetectedWebJarLib = isWebJar(file);
        if (listOfDetectedWebJarLib != null) {
            JarFile jar = null;
            try {
                jar = new JarFile(file);
                List<FileWebJarLib> installed = new ArrayList<>();
                for (DetectedWebJar detected : listOfDetectedWebJarLib) {
                    FileWebJarLib lib = expand(detected, jar);
                    if (lib != null) {
                        libs.add(lib);
                        installed.add(lib);
                        LOGGER.info("{} unpacked to {}", lib.name, lib.root.getAbsolutePath());
                    }
                }
                controller.addWebJarLibs(installed);
            } catch (IOException e) {
                LOGGER.error("Cannot open the jar file {}", file.getAbsolutePath(), e);
            } finally {
                IOUtils.closeQuietly(jar);
            }

        }
    }
707040
@Override
    public void actionCommit() {

        List<Throwable> errors = new ArrayList<Throwable>();

        try {
            if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
                // fill the values
                Iterator<CmsUserAddInfoBean> it = m_addInfoList.iterator();
                while (it.hasNext()) {
                    CmsUserAddInfoBean infoBean = it.next();
                    if (infoBean.getValue() == null) {
                        m_user.deleteAdditionalInfo(infoBean.getName());
                    } else {
                        m_user.setAdditionalInfo(
                            infoBean.getName(),
                            CmsDataTypeUtil.parse(infoBean.getValue(), infoBean.getType()));
                    }
                }
            } else {
                Map<String, Object> readOnly = new HashMap<String, Object>();
                Iterator<Entry<String, Object>> itEntries = m_user.getAdditionalInfo().entrySet().iterator();
                while (itEntries.hasNext()) {
                    Entry<String, Object> entry = itEntries.next();
                    if (!CmsDataTypeUtil.isParseable(entry.getValue().getClass())) {
                        String key = entry.getKey().toString();
                        if (!entry.getValue().getClass().equals(String.class)) {
                            key += "@" + entry.getValue().getClass().getName();
                        }
                        if (m_addInfoReadOnly.containsKey(key)) {
                            readOnly.put(entry.getKey(), entry.getValue());
                        }
                    }
                }
                m_user.setAdditionalInfo(readOnly);
                itEntries = m_addInfoEditable.entrySet().iterator();
                while (itEntries.hasNext()) {
                    Entry<String, Object> entry = itEntries.next();
                    String key = entry.getKey();
                    int pos = key.indexOf("@");
                    if (pos < 0) {
                        m_user.setAdditionalInfo(key, entry.getValue());
                        continue;
                    }
                    String className = key.substring(pos + 1);
                    key = key.substring(0, pos);
                    Class<?> clazz;
                    try {
                        // try the class name
                        clazz = Class.forName(className);
                    } catch (Throwable e) {
                        try {
                            // try the class in the java.lang package
                            clazz = Class.forName(Integer.class.getPackage().getName() + "." + className);
                        } catch (Throwable e1) {
                            clazz = String.class;
                        }
                    }
                    m_user.setAdditionalInfo(key, CmsDataTypeUtil.parse((String)entry.getValue(), clazz));
                }
            }

            // write the edited user
            getCms().writeUser(m_user);
        } catch (Throwable t) {
            errors.add(t);
        }

        if (errors.isEmpty()) {
            if (getCurrentToolPath().endsWith("/orgunit/users/edit/addinfo/all")) {
                // set closelink
                Map<String, String[]> argMap = new HashMap<String, String[]>();
                argMap.put(A_CmsEditUserDialog.PARAM_USERID, new String[] {m_user.getId().toString()});
                argMap.put("oufqn", new String[] {m_user.getOuFqn()});
                setParamCloseLink(
                    CmsToolManager.linkForToolPath(
                        getJsp(),
                        getCurrentToolPath().substring(
                            0,
                            getCurrentToolPath().indexOf("/orgunit/users/edit/addinfo/all")) + "/orgunit/users/edit/",
                        argMap));
            }
        }

        // set the list of errors to display when saving failed
        setCommitErrors(errors);
    }
1264537
public void setTypes(java.util.Collection<Type> types) {
        if (types == null) {
            this.types = null;
            return;
        }

        this.types = new java.util.ArrayList<Type>(types);
    }
1327745
public void init(final Collection<String> localSchemaNames, final Map<String, Map<String, YamlDataSourceParameter>> schemaDataSources,
                     final Map<String, RuleConfiguration> schemaRules, final boolean isUsingRegistry) {
        databaseType = JDBCDriverURLRecognizerEngine.getDatabaseType(schemaDataSources.values().iterator().next().values().iterator().next().getUrl());
        initSchemas(localSchemaNames, schemaDataSources, schemaRules, isUsingRegistry);
    }
1323463
protected void loadProperties(String filename) {
		ClassLoader thclassLoader = Thread.currentThread().getContextClassLoader();
		if (thclassLoader != null){
			URL url = thclassLoader.getResource(filename);
			if (url != null){
				try {
					this.setXMLProperties(url.openStream(), null);
				} catch (Exception e) {
					// do nothing
				} 
			}
		}
	}
1231142
public void setAttributes(java.util.Collection<TypedLinkAttributeDefinition> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<TypedLinkAttributeDefinition>(attributes);
    }
27427
public void init() {
    String fileName = null;
    try {
      fileName = System.getProperty(SYSTEM_PROPERTY);
      if (fileName == null) {
        LOG.info("User file configuration not provided, reading default file.");
        readConfiguration(getClass().getResourceAsStream(DEFAULT_FILE_NAME));
      } else {
        try {
          FileInputStream stream = new FileInputStream(fileName);
          LOG.info("Reading configuration file: " + fileName);
          readConfiguration(stream);
        } catch (FileNotFoundException fnfe) {
          LOG.info("Error using user provided configuration file, reading default file.");
          readConfiguration(getClass().getResourceAsStream(DEFAULT_FILE_NAME));
        }
      }
    } catch (IOException ioe) {
      LOG.error("Error reading provided " + fileName + " file");
    }
  }
549441
public void setColumns(java.util.Collection<Column> columns) {
        if (columns == null) {
            this.columns = null;
            return;
        }

        this.columns = new java.util.ArrayList<Column>(columns);
    }
1259417
@PostConstruct
  public void initialize() {

    if (this.initializationState.setInitializing()) {
      if (this.visibility == null) {
        this.visibility = VisibilityModifier.PUBLIC;
      }
      this.initializationState.setInitialized();
    }
  }
550741
@Override public void lcompute() {
    _ok = new int[_files.length][H2O.CLOUD.size()];
    for (int i = 0; i < _files.length; ++i) {
      File f = new File(_files[i]);
      if (f.exists() && (f.length()==_sizes[i]))
        _ok[i][H2O.SELF.index()] = 1;
    }
    tryComplete();
  }
1279878
private void setIndicesAndTypes() {
        request.setIndices(query.getIndexArr());

        String[] typeArr = query.getTypeArr();
        if (typeArr != null) {
            request.setTypes(typeArr);
        }
    }
467831
public void setImageDetails(java.util.Collection<ImageDetail> imageDetails) {
        if (imageDetails == null) {
            this.imageDetails = null;
            return;
        }

        this.imageDetails = new java.util.ArrayList<ImageDetail>(imageDetails);
    }