public static void logTable(LogTableContext context) { String table = getTable(context); Assert.notNull(context.getLogger(), "logger is null"); Assert.notNull(context.getLevel(), "level is null"); String msg = context.getTitle() + "\n\n" + table; logMsg(msg, context.getLogger(), context.getLevel()); }
public ResourcesSupplierFactory(String extension, List<LocationSupplierFactory> factories) { Assert.noBlanks(extension); Assert.isFalse(CollectionUtils.isEmpty(factories), "Must provide at least one factory"); this.factories = ListUtils.newImmutableArrayList(factories); this.extension = extension; this.suffix = "." + extension; }
public LogTableContext(String title, List<String> columns, List<Object[]> rows, LoggerLevel level, Logger logger, boolean leftAlign) { Assert.noNulls(columns, rows, logger, level); Assert.noBlanks(title); this.title = title; this.columns = ListUtils.newImmutableArrayList(columns); this.rows = ListUtils.newImmutableArrayList(rows); this.level = level; this.logger = logger; this.leftAlign = leftAlign; }
/** * Return the relative path to <code>file</code> from <code>parentDir</code>. <code>parentDir</code> is optional and can be <code>null</code>. If <code>parentDir</code> is not * supplied (or is not a parent directory to <code>file</code> the canonical path to <code>file</code> is returned. */ public static String getRelativePathQuietly(File parentDir, File file) { Assert.notNull(file, "file is null"); if (isParent(parentDir, file)) { return getRelativePath(parentDir, file); } else { return LocationUtils.getCanonicalPath(file); } }
public DefaultPropertiesService(Properties overrides, PropertyProcessor postProcessor) { Assert.noNulls(overrides, postProcessor); this.overrides = PropertyUtils.toImmutable(overrides); this.postProcessor = postProcessor; }
public SimpleScanner(File baseDir, List<String> includes, List<String> excludes) { if (baseDir != null) { setBasedir(baseDir); } if (!CollectionUtils.isEmpty(includes)) { setIncludes(CollectionUtils.toStringArray(includes)); } if (!CollectionUtils.isEmpty(excludes)) { setExcludes(CollectionUtils.toStringArray(excludes)); } }
public String chown(List<String> options, String owner, String group, List<String> paths) { Assert.notEmpty(paths); Assert.noBlanks(owner, group); return cmd(CHOWN, CollectionUtils.combineStrings(options, owner + ":" + group, paths)); }
public WriteLines(WriteRequest request, List<String> lines) { Assert.noNulls(request, lines); this.request = request; this.lines = ListUtils.newImmutableArrayList(lines); }
/** * Assert that <code>text</code> is concealed */ public static void concealed(String text) { isTrue(Str.isConcealed(text), "text must be concealed"); }
public String chmod(List<String> options, String mode, List<String> paths) { Assert.hasLength(mode); Assert.notEmpty(paths); return cmd(CHMOD, CollectionUtils.combineStrings(options, mode, paths)); }
/** * Return a new <code>Properties</code> object loaded from <code>file</code>. */ public static final Properties loadSilently(File file) { return loadSilently(LocationUtils.getCanonicalPath(file)); }
/** * Given a project containing groupId + artifactId, convert the groupId to groupId.base, then return the classpath prefix * * <pre> * org.kuali.student.db:ks-impex-rice-db = classpath:org/kuali/student/ks-impex-rice-db * org.kuali.common:kuali-util = classpath:org/kuali/common/kuali-util * </pre> */ public static String getClassPathPrefix(Project project) { return getClassPathPrefix(project.getGroupId(), project.getArtifactId()); }
public String rm(List<String> options, List<String> paths) { Assert.notEmpty(paths); return cmd(RM, CollectionUtils.combineStrings(options, paths)); }
public WriteProperties(WriteRequest request, Properties properties) { Assert.noNulls(request, properties); this.request = request; this.properties = PropertyUtils.toImmutable(properties); }
public VendorSql(AdminSql admin, DbaSql dba, Properties all) { Assert.noNulls(admin, dba, all); this.admin = admin; this.dba = dba; this.all = PropertyUtils.toImmutable(all); }