/sdm/src/com/google/code/sagetvaddons/sdm/properties/PluginPropertyOnCompleteCommand.java
http://sagetv-addons.googlecode.com/ · Java · 45 lines · 19 code · 7 blank · 19 comment · 2 complexity · 065c7649199778bbc835388f4732d70a MD5 · raw file
- /*
- * Copyright 2011 Battams, Derek
- *
- * 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.google.code.sagetvaddons.sdm.properties;
-
- import sage.SageTVPlugin;
- import sagex.api.Utility;
- import sagex.plugin.IPropertyValidator;
-
- import com.google.code.sagetvaddons.sdm.Plugin;
-
- /**
- * @author dbattams
- *
- */
- public final class PluginPropertyOnCompleteCommand extends PluginPropertyServerPersisted {
-
- static private final String PROP_NAME = Plugin.PROP_PREFIX + "on_complete_cmd";
- static private final String PROP_DEFAULT = "";
-
- public PluginPropertyOnCompleteCommand() {
- super(SageTVPlugin.CONFIG_FILE, PROP_NAME, PROP_DEFAULT, "On Download Completed Hook", "Specify a command to execute everytime a download completes successfully.");
- setValidator(new IPropertyValidator() {
-
- @Override
- public void validate(String prop, String val) throws Exception {
- if(!"".equals(val) && !Utility.IsFilePath(val))
- throw new IllegalArgumentException(String.format("Specified file does not exist on SageTV server! [%s]", val));
- }
-
- });
- }
- }