use of org.jetbrains.annotations.NotNull in project scss-lint-plugin by idok.
the class FileUtils method displayDirectoryContents.
@NotNull
public static List<String> displayDirectoryContents(@NotNull File projectRoot, @NotNull File dir, @NotNull FilenameFilter filter) {
List<String> ret = listFiles(projectRoot, dir, filter);
File[] files = dir.listFiles();
for (final File file : files) {
if (file.isDirectory()) {
ret.addAll(displayDirectoryContents(projectRoot, file, filter));
// } else {
// listFiles(file, filter, allFiles);
}
}
return ret;
}
use of org.jetbrains.annotations.NotNull in project scss-lint-plugin by idok.
the class FileUtils method findExeFilesInPath.
@NotNull
private static List<File> findExeFilesInPath(@Nullable String pathEnvVarValue, @NotNull String fileBaseName, boolean stopAfterFirstMatch, boolean logDetails) {
if (logDetails) {
LOG.info("Finding files in PATH (base name=" + fileBaseName + ", PATH=" + StringUtil.notNullize(pathEnvVarValue) + ").");
}
if (pathEnvVarValue == null) {
return Collections.emptyList();
}
List<File> result = new SmartList<File>();
List<String> paths = StringUtil.split(pathEnvVarValue, File.pathSeparator, true, true);
for (String path : paths) {
File dir = new File(path);
if (logDetails) {
File file = new File(dir, fileBaseName);
LOG.info("path:" + path + ", path.isAbsolute:" + dir.isAbsolute() + ", path.isDirectory:" + dir.isDirectory() + ", file.isFile:" + file.isFile() + ", file.canExecute:" + file.canExecute());
}
if (dir.isAbsolute() && dir.isDirectory()) {
File file = new File(dir, fileBaseName);
if (file.isFile() && file.canExecute()) {
result.add(file);
if (stopAfterFirstMatch) {
return result;
}
}
}
}
return result;
}
use of org.jetbrains.annotations.NotNull in project actor-platform by actorapp.
the class ContactContent method create.
@NotNull
public static ContactContent create(@NotNull String name, @NotNull ArrayList<String> phones, @NotNull ArrayList<String> emails, @Nullable String base64photo) {
try {
JSONObject obj = new JSONObject();
obj.put("dataType", "contact");
JSONObject contact = new JSONObject();
contact.put("name", name);
if (base64photo != null) {
contact.put("photo", base64photo);
}
JSONArray phoneArray = new JSONArray();
for (String phone : phones) {
phoneArray.put(phone);
}
JSONArray emailArray = new JSONArray();
for (String phone : emails) {
emailArray.put(phone);
}
contact.put("emails", emailArray);
contact.put("phones", phoneArray);
JSONObject data = new JSONObject();
data.put("contact", contact);
obj.put("data", data);
return new ContactContent(new ContentRemoteContainer(new ApiJsonMessage(obj.toString())));
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
use of org.jetbrains.annotations.NotNull in project adb-idea by pbreault.
the class MyDeviceChooser method getSelectedDevices.
@NotNull
public IDevice[] getSelectedDevices() {
int[] rows = mySelectedRows != null ? mySelectedRows : myDeviceTable.getSelectedRows();
List<IDevice> result = new ArrayList<IDevice>();
for (int row : rows) {
if (row >= 0) {
Object serial = myDeviceTable.getValueAt(row, SERIAL_COLUMN_INDEX);
final AndroidDebugBridge bridge = AndroidSdkUtils.getDebugBridge(myFacet.getModule().getProject());
if (bridge == null) {
return EMPTY_DEVICE_ARRAY;
}
IDevice[] devices = getFilteredDevices(bridge);
for (IDevice device : devices) {
if (device.getSerialNumber().equals(serial.toString())) {
result.add(device);
break;
}
}
}
}
return result.toArray(new IDevice[result.size()]);
}
use of org.jetbrains.annotations.NotNull in project midpoint by Evolveum.
the class ResourceValidatorImpl method getString.
@NotNull
private String getString(ResourceBundle bundle, String key, Object... parameters) {
final String resolvedKey;
if (key != null) {
if (bundle.containsKey(key)) {
resolvedKey = bundle.getString(key);
} else {
resolvedKey = key;
}
} else {
resolvedKey = "";
}
final MessageFormat format = new MessageFormat(resolvedKey, bundle.getLocale());
return format.format(parameters);
}
Aggregations