关于Eclipse中校验输入文件名的源代码
Eclipse中测试文件名的方法.
也没有单独的分操作系统.在Talend时解决一个在文本框中输入名字有Bug的一个问题,这个是Eclipse中解决输入名字,对名字校验的部分源码.
public IStatus validateName(String segment, int type) {
String message;
/* segment must not be null */
if (segment == null) {
message = Messages.resources_nameNull;
return new ResourceStatus(IResourceStatus.INVALID_VALUE, null, message);
}
// cannot be an empty string
if (segment.length() == 0) {
message = Messages.resources_nameEmpty;
return new ResourceStatus(IResourceStatus.INVALID_VALUE, null, message);
}
/* test invalid characters */
char[] chars = OS.INVALID_RESOURCE_CHARACTERS;
for (int i = 0; i < chars.length; i++)
if (segment.indexOf(chars[i]) != -1) {
message = NLS.bind(Messages.resources_invalidCharInName, String.valueOf(chars[i]), segment);
return new ResourceStatus(IResourceStatus.INVALID_VALUE, null, message);
}
/* test invalid OS names */
if (!OS.isNameValid(segment)) {
message = NLS.bind(Messages.resources_invalidName, segment);
return new ResourceStatus(IResourceStatus.INVALID_VALUE, null, message);
}
return Status.OK_STATUS;
}
关于Eclipse中校验输入文件名的源代码的更多相关文章
- 在Eclipse中查看JDK类库的源代码
http://blog.csdn.net/a81895898/article/details/8486802 在Eclipse中查看JDK类库的源代码!!! 设置: 1.点 “window”-> ...
- Eclipse中查看JDK类库的源代码
在Eclipse中查看JDK类库的源代码!!! 设置: 1.点 “window”-> "Preferences" -> "Java" -> & ...
- (转)如何在Eclipse中查看JDK类库的源代码
在Eclipse中查看JDK类库的源代码!!! 设置: 1.点 “window”-> "Preferences" -> "Java" -> & ...
- Eclipse中导入JDK类库的源代码以及添加指定的API
一.在Eclipse中导入JDK类库的源代码 操作步骤: 打开eclipse->“window”-> “Preferences” -> “Java” -> “Installed ...
- 查看Eclipse中的jar包的源代码:jd-gui.exe
前面搞了很久的使用JAD,各种下载插件,最后配置好了,还是不能用,不知道怎么回事, 想起一起用过的jd-gui.exe这个工具,是各种强大啊!!! 只需要把jar包直接扔进去就可以了,非常清晰,全部解 ...
- eclipse中的输入提示怎么设置
对于大多数的开发人员来说,打代码是一件非常繁琐的事情,eclipse中为我们提供了自动提示的功能,但是默认的提示只有当我们输入小数点后才能出现提示框,那么我们如何设置eclipse,能够让它为我们提示 ...
- 4.eclipse中导入别人用的源代码问题
最近在导入别人用的源代码问题时,出现两个问题: 问题一:提示无法解析导入,如下图: 解决方法:删除项目下的module-info.java文件即可,或者在创建项目时将创建module-info.jav ...
- (转)Eclipse中快速输入System.out.println()的快捷键
https://blog.csdn.net/ShiMengRan107/article/details/73614417 善用 Eclipse 组合键,可以提高输入效率. Step1: Eclipse ...
- 如何在Eclipse中查看Java类库的源代码以及相应的api
你的JDK安装目录下%Java_home%/src.zip文件就是源码,解压缩找到对应包下面的类即可. 如果是Eclipse开发,ctr+鼠标左击,出现不了源码的话,在弹出的视图中点击attach s ...
随机推荐
- 【转】从零开始,让你的框架支持CocoaPods
首先概括一个大概的步骤: 代码上传到Github 创建podspec文件 在Github上创建release版本 注册CocoaPods账号 上传代码到CocoaPods 检验是否上传成功 更新框架版 ...
- HDU 5816 Hearthstone (状压DP)
Hearthstone 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5816 Description Hearthstone is an onlin ...
- 又遇BUG-ORA-01148:数据文件忽然变为recover状态
现象: RAC环境,数据文件状态变为recover,查看alert日志有如下报错: Wed Jun 26 02:31:03 2013 Thread 1 advanced to log sequence ...
- map的正确删除方式
遍历删除map元素的正确方式是 for(itor = maptemplate.begin; itor != maptemplate.end(); ) { if(neederase) ...
- HTML5结构化标签
一 结构化标签 在之前的HTML页面中,大家基本上都是用了Div+CSS的布局方式.而搜索引擎去抓取页面的内容的时候,它只能猜测你的某个Div内的内容是文章内容容器,或者是导航模块的容器,或者是作者介 ...
- Cocos2d-x——CocosBuilder官方帮助文档翻译2 多分辨率支持
Working with Multiple Resolutions 多分辨率设置 A common scenario when creating apps or games is to target ...
- contiki-main.c 一 打印观察 <contiki学习之五>
说明: 本文依赖于 contiki/platform/native/contiki-main.c 文件. 在项目工程目录下的hello-world.c 文件里面,有许多的宏,但没有最关键的main() ...
- contiki makefile框架分析 < contiki学习之一 >
在linux下的工程编译,基本都可以使用makefile这个工具来完成.Contiki OS亦如此,下面分析contiki整个Makefile的框架,对makefile的具体内容暂不做分析.本文依赖于 ...
- Educational Codeforces Round 2 A. Extract Numbers 模拟题
A. Extract Numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/pr ...
- PhpStorm, XDebug, and DBGp Proxy
phpstorm 利用 xdebug.dbgp-proxy配置远程调试 1.单客户机远程调试 a.安装xdebug库文件(windows:php_xdebug.dll;linux:php_xdebug ...