Here you can find the source of isBallerinaProject(Path path)
Parameter | Description |
---|---|
path | path to suspecting dir |
public static boolean isBallerinaProject(Path path)
//package com.java2s; /*/*from w w w .j a va 2s . c o m*/ * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.nio.file.Files; import java.nio.file.Path; public class Main { /** * Is {@code path} is a valid ballerina project directory. * * @param path path to suspecting dir * @return if {@code path} is a ballerina project directory or not */ public static boolean isBallerinaProject(Path path) { boolean isProject = false; Path cachePath = path.resolve(".ballerina"); // .ballerina cache path should exist in ballerina project directory if (Files.exists(cachePath)) { isProject = true; } return isProject; } }