Skip to content

Commit

Permalink
Merge pull request #528 from suryajak/v1.8.1
Browse files Browse the repository at this point in the history
Remove copyright headers from template files
  • Loading branch information
suryajak authored Aug 24, 2018
2 parents fda0e83 + dc1e5c2 commit 557918d
Show file tree
Hide file tree
Showing 29 changed files with 45 additions and 488 deletions.
2 changes: 1 addition & 1 deletion builds/jenkins-build-pack-lambda/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def validateDeploymentConfigurations(def prop) {
if (_runtime == "") {
error "Wrong configuration. Value for Key 'providerRuntime' is missing in the configuration"
} else {
def validRuntimes = ["nodejs4.3", "nodejs6.10", "python2.7", "java8"] //@TODO. Add more runtime supports. DSundar3
def validRuntimes = ["nodejs4.3", "nodejs6.10", "python2.7", "java8"] //@TODO. Add more runtime supports.
def flag = false

for (int i = 0; i < validRuntimes.size(); i++) {
Expand Down
16 changes: 0 additions & 16 deletions templates/api-template-nodejs/components/config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright © 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

/**
Nodejs Template Project
@module: config.js
Expand Down
24 changes: 4 additions & 20 deletions templates/api-template-nodejs/components/error-handler.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright © 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

/**
Nodejs Template Project
@module: error-handler.js
Expand All @@ -36,25 +20,25 @@ module.exports = () => {
message: errorMessage.toString()
}
),
throwUnauthorizedError: (errorMessage) => (
throwUnauthorizedError: (errorMessage) => (
{
errorType: "Unauthorized",
message: errorMessage.toString()
}
),
throwNotFoundError: (errorMessage) => (
throwNotFoundError: (errorMessage) => (
{
errorType: "NotFound",
message: errorMessage.toString()
}
),
throwInternalServerError: (errorMessage) => (
throwInternalServerError: (errorMessage) => (
{
errorType: "InternalServerError",
message: errorMessage.toString()
}
)
};

return errorObj;
};
16 changes: 0 additions & 16 deletions templates/api-template-nodejs/components/logger.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright © 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

/**
Nodejs Template Project
@module: logger.js
Expand Down
16 changes: 0 additions & 16 deletions templates/api-template-nodejs/components/response.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright © 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

/**
Nodejs Template Project
@module: response.js
Expand Down
16 changes: 0 additions & 16 deletions templates/api-template-nodejs/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright © 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

/**
Nodejs Template Project
@author:
Expand Down
16 changes: 0 additions & 16 deletions templates/api-template-nodejs/test/test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright © 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

const assert = require('chai').assert;
const index = require('../index');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

package com.slf.exceptions;

public class BadRequestException extends BaseException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

package com.slf.exceptions;

import com.slf.model.ErrorInfo;
Expand All @@ -24,25 +8,25 @@
public class BaseException extends RuntimeException {

private ErrorInfo err = new ErrorInfo();

public BaseException(String errortype, String message) {
err.setErrorType(errortype);
err.setMessage(message);
}

@Override
public String getMessage(){
String jsonInString = null;

try {
ObjectMapper mapper = new ObjectMapper();
jsonInString = mapper.writeValueAsString(err);

} catch (JsonProcessingException ex) {
throw new InternalServerErrorException("Parsor Error occured.");
}
return jsonInString;

return jsonInString;
}
}

}
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
// =========================================================================
// Copyright 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

package com.slf.exceptions;

public class InternalServerErrorException extends BaseException {

public InternalServerErrorException(String message) {
super("InternalServerError", message);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
// =========================================================================
// Copyright 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

package com.slf.exceptions;

public class NotFoundException extends BaseException {

public NotFoundException(String message) {
super("NotFound", message);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,22 @@
// =========================================================================
// Copyright 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

package com.slf.model;

public class ErrorInfo {

private String errorType;
private String message;

public ErrorInfo(String errorType, String message) {
this.errorType = errorType;
this.message = message;
}

public ErrorInfo(String message) {
this.message = message;
}

public ErrorInfo() {
}

public String getErrorType() {
return errorType;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

package com.slf.model;

public class Request {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
// =========================================================================
// Copyright 2017 T-Mobile USA, Inc.
//
// 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.
// =========================================================================

package com.slf.model;

import java.util.Map;
Expand Down
Loading

0 comments on commit 557918d

Please sign in to comment.