Method to get the optional syntax for order by operator

@param Path the path
@return OptionalSyntax the optional syntax
764642
public OptionalSyntax orderBy(Path<?>... path) {
		String fieldList = "";
		boolean firstExpression = true;
		for (Path<?> exp : path) {
			if (firstExpression) {
				fieldList = fieldList.concat(exp.toString());
				firstExpression = false;
			} else {
				fieldList = fieldList.concat(", ").concat(exp.toString());
			}

			LOG.debug("expression: " + exp);
		}
		QueryMessage mess = getMessage();
		mess.setOrderByClause(fieldList);
		return new OptionalSyntax(mess);
	}
77971
public static String nativeDirectorySeparator(final String path) {
    if (path == null)
      return StringUtil.empty;
    return path.replace("/", directorySeparator).replace("\\", directorySeparator);
  }
633030
public static String optionallyRemovePrecedingSlash(final String path) {
        // Precondition check
        assertSpecified(path);

        // Is there's a first character of slash
        if (isFirstCharSlash(path)) {
            // Return everything but first char
            return path.substring(1);
        }

        // Return as-is
        return path;
    }
522973
public static <T> Optional<T> getNullableOptional(final List list, final Class<T> clazz, final Integer... path) {
        return getNullable(list, Optional.class, path);
    }
184485
public static Optional<List<Long>> getLongListOptional(Config config, String path) {
        return Optional.ofNullable(getLongList(config, path));
    }
794361
@SuppressWarnings("unchecked")
    @Nullable
    public <T> T executeWithKey(Path<T> path) {
        return executeWithKey((Class<T>) path.getType(), path);
    }
1216178
@SuppressWarnings("unchecked")
	public TreeNode<T> findByPath(T... path) {
		return findByPath(Arrays.asList(path));
	}
1194621
@Nonnull
  public Query orderBy(@Nonnull FieldPath fieldPath) {
    return orderBy(fieldPath, Direction.ASCENDING);
  }
138077
public static List<File> getDirectories(File path)
    {
        Check.notNull(path);

        return Optional.ofNullable(path.listFiles())
                       .map(files -> Arrays.asList(files)
                                           .stream()
                                           .filter(File::isDirectory)
                                           .collect(Collectors.toList()))
                       .orElseGet(Collections::emptyList);
    }
763793
public static String readFirstLine(String path) throws FileNotFoundException, IOException {
        try (FileInputStream fis = new FileInputStream(path)) {
            try (InputStreamReader isr = new InputStreamReader(fis)) {
                try (BufferedReader br = new BufferedReader(isr)) {
                    return br.readLine();
                }
            }
        }
    }
442109
public static Optional<Object> get(final Map map, final Object... path) {
        return get(map, Object.class, path);
    }
788838
public static Optional<String> getString(final Map map, final Object... path) {
        return get(map, String.class, path);
    }
892389
public static Optional<Path> createTempDirPathAsOpt(Path path) {
        debug(log, "createTempDirPathAsOpt", path);
        try {
            return Optional.of(Files.createTempDirectory(path.toString()))
                    .filter(JMPath.ExistFilter)
                    .map(JMPathOperation::deleteOnExit);
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndReturnEmptyOptional(log,
                    e, "createTempDirPathAsOpt", path);
        }
    }
239080
@Override
    public int compareTo(final Path other) {
        if (other == null) {
            throw new IllegalArgumentException("other path must be specified");
        }
        // Just defer to alpha ordering since we're absolute
        return this.toString().compareTo(other.toString());
    }
328435
public @Nonnull Optional<URL> getResource(@Nonnull String path) {
        ArgumentUtils.requireNonNull("path", path);
        Optional<ResourceLoader> resourceLoader = getSupportingLoader(path);
        if (resourceLoader.isPresent()) {
            return resourceLoader.get().getResource(path);
        }
        return Optional.empty();
    }
68764
public static Stream<Path> getChildrenPathStream(Path path) {
		return Optional.ofNullable(path.toFile().listFiles())
				.map(listFiles -> Stream.of(listFiles).map(File::toPath))
				.orElseGet(Stream::empty);
	}
1341707
public static Optional<List<String>> getStringListOptional(Config config, String path) {
        return Optional.ofNullable(getStringList(config, path));
    }