List of usage examples for org.apache.commons.lang3 ExtendedValidate isTrue
public static final void isTrue(boolean value, String msg, Object obj)
From source file:org.apache.sshd.common.file.nativefs.ExtendedNativeFileSystemFactory.java
@Override public FileSystemView createFileSystemView(Session session) { String userName = session.getUsername(); File rootDir = Validate.notNull(getSessionRootDir(session), "No root folder resolved", ArrayUtils.EMPTY_OBJECT_ARRAY); if (rootDir.exists()) { ExtendedValidate.isTrue(rootDir.isDirectory(), "Not a directory: %s", rootDir); } else if (isCreateHome()) { if (!rootDir.mkdirs()) { throw new IllegalStateException("Failed to create root directory: " + rootDir); }/*from w w w .j a v a 2 s . c o m*/ if (logger.isDebugEnabled()) { logger.debug("createFileSystemView(" + userName + ") created " + rootDir); } } else { throw new IllegalStateException("Resolved root directory not found: " + rootDir); } return new ExtendedNativeFileSystemView(userName, rootDir, isCaseInsensitive()); }