/*
* Copyright 2012 Smartling, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this work except in compliance with the License.
* You may obtain a copy of the License in the LICENSE file, or 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 com.smartling.api.sdk.file.*;
import com.smartling.api.sdk.file.parameters.FileUploadParameterBuilder;
import com.smartling.api.sdk.file.response.*;
import java.io.File;
import org.apache.commons.io.FilenameUtils;
public class SmartlingApiExample
{
private static final String API_KEY = "YOUR-API-KEY";
private static final String PROJECT_ID = "YOUR-PROJECT-ID";
private static final String LOCALE = "YOUR-LOCALE";
private static final String PATH_TO_FILE = "resources/test.properties";
private static final String FILE_ENCODING = "UTF-8";
private static final FileType FILE_TYPE = FileType.JAVA_PROPERTIES;
private static final String CALLBACK_URL = null;
public static void main(String args[]) throws FileApiException
{
FileApiClientAdapter smartlingFAPI = new FileApiClientAdapterImpl(true, API_KEY, PROJECT_ID);
// upload the file
File file = new File(FilenameUtils.separatorsToSystem(PATH_TO_FILE));
FileUploadParameterBuilder fileUploadParameterBuilder = new FileUploadParameterBuilder();
fileUploadParameterBuilder
.fileType(FILE_TYPE)
.fileUri(getFileUri(file))
.approveContent(false)
.callbackUrl(CALLBACK_URL);
ApiResponse