本文整理汇总了Java中org.apache.harmony.luni.util.Util.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Util.toString方法的具体用法?Java Util.toString怎么用?Java Util.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.luni.util.Util
的用法示例。
在下文中一共展示了Util.toString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: list
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Answers an array of Strings representing the file names in the directory
* represented by this File. If this File is not a directory the result is
* <code>null</code>.
* <p>
* The entries <code>.</code> and <code>..</code> representing current
* directory and parent directory are not returned as part of the list.
*
* @return an array of Strings or <code>null</code>.
*
* @see #getPath
* @see #isDirectory
* @see java.lang.SecurityManager#checkRead(FileDescriptor)
*/
public java.lang.String[] list() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkRead(path);
}
if (!isDirectory()) {
return null;
}
byte[][] implList = listImpl(properPath(true));
if (implList == null) {
return new String[0];
}
String result[] = new String[implList.length];
for (int index = 0; index < implList.length; index++) {
result[index] = Util.toString(implList[index]);
}
return result;
}
示例2: listFiles
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Answers an array of Files representing the file names in the directory
* represented by this File that match a specific filter. If this File is
* not a directory the result is <code>null</code>. If the filter is
* <code>null</code> then all filenames match.
* <p>
* The entries <code>.</code> and <code>..</code> representing current
* directory and parent directory are not returned as part of the list.
*
* @param filter
* the filter to match names to or <code>null</code>.
* @return an array of Files or <code>null</code>.
*
* @see #getPath
* @see #isDirectory
* @see java.lang.SecurityManager#checkRead(FileDescriptor)
*/
public File[] listFiles(FileFilter filter) {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkRead(path);
}
if (!isDirectory()) {
return null;
}
byte[][] implList = listImpl(properPath(true));
if (implList == null) {
return new File[0];
}
List<File> tempResult = new ArrayList<File>();
for (int index = 0; index < implList.length; index++) {
String aName = Util.toString(implList[index]);
File aFile = new File(this, aName);
if (filter == null || filter.accept(aFile)) {
tempResult.add(aFile);
}
}
return tempResult.toArray(new File[tempResult.size()]);
}
示例3: listRoots
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Lists the file system roots. The Java platform may support zero or more
* file systems, each with its own platform-dependent root. Further, the
* canonical pathname of any file on the system will always begin with one
* of the returned file system roots.
*
* @return the array of file system roots.
*/
public static File[] listRoots() {
byte[][] rootsList = rootsImpl();
if (rootsList == null) {
return new File[0];
}
File result[] = new File[rootsList.length];
for (int i = 0; i < rootsList.length; i++) {
result[i] = new File(Util.toString(rootsList[i]));
}
return result;
}
示例4: listFiles
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Gets a list of the files in the directory represented by this file. This
* list is then filtered through a FileFilter and matching files are
* returned as an array of files. Returns {@code null} if this file is not a
* directory. If {@code filter} is {@code null} then all files match.
* <p>
* The entries {@code .} and {@code ..} representing the current and parent
* directories are not returned as part of the list.
*
* @param filter
* the filter to match names against, may be {@code null}.
* @return an array of files or {@code null}.
* @throws SecurityException
* if a {@code SecurityManager} is installed and it denies read
* access to this file.
* @see #getPath
* @see #isDirectory
* @see java.lang.SecurityManager#checkRead(FileDescriptor)
*/
public File[] listFiles(FileFilter filter) {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkRead(path);
}
if (path.length() == 0) {
return null;
}
byte[] bs = properPath(true);
if (!isDirectoryImpl(bs) || !existsImpl(bs) || isWriteOnlyImpl(bs)) {
return null;
}
byte[][] implList = listImpl(bs);
if (implList == null) {
return new File[0];
}
List<File> tempResult = new ArrayList<File>();
for (int index = 0; index < implList.length; index++) {
String aName = Util.toString(implList[index]);
File aFile = new File(this, aName);
if (filter == null || filter.accept(aFile)) {
tempResult.add(aFile);
}
}
return tempResult.toArray(new File[tempResult.size()]);
}
示例5: list
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Gets a list of the files in the directory represented by this file. This
* list is then filtered through a FilenameFilter and the names of files
* with matching names are returned as an array of strings. Returns
* {@code null} if this file is not a directory. If {@code filter} is
* {@code null} then all filenames match.
* <p>
* The entries {@code .} and {@code ..} representing the current and parent
* directories are not returned as part of the list.
*
* @param filter
* the filter to match names against, may be {@code null}.
* @return an array of files or {@code null}.
* @throws SecurityException
* if a {@code SecurityManager} is installed and it denies read
* access to this file.
* @see #getPath
* @see #isDirectory
* @see java.lang.SecurityManager#checkRead(FileDescriptor)
*/
public java.lang.String[] list(FilenameFilter filter) {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkRead(path);
}
if (path.length() == 0) {
return null;
}
byte[] bs = properPath(true);
if (!isDirectoryImpl(bs) || !existsImpl(bs) || isWriteOnlyImpl(bs)) {
return null;
}
byte[][] implList = listImpl(bs);
if (implList == null) {
// empty list
return new String[0];
}
List<String> tempResult = new ArrayList<String>();
for (int index = 0; index < implList.length; index++) {
String aName = Util.toString(implList[index]);
if (filter == null || filter.accept(this, aName)) {
tempResult.add(aName);
}
}
return tempResult.toArray(new String[tempResult.size()]);
}
示例6: listRoots
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Lists the filesystem roots.
*
* The Java platform may support zero or more filesystems, each with its own
* platform-dependent root. Further, the canonical pathname of any file on
* the system will always begin with one of the returned filesystem roots.
*
* @return the array of filesystem roots
*/
public static File[] listRoots() {
byte[][] rootsList = rootsImpl();
if (rootsList == null) {
return new File[0];
}
File result[] = new File[rootsList.length];
for (int i = 0; i < rootsList.length; i++) {
result[i] = new File(Util.toString(rootsList[i]));
}
return result;
}
示例7: getAbsolutePath
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Answers the absolute file path of this File.
*
* @return the absolute file path
*
* @see java.lang.SecurityManager#checkPropertyAccess
*/
public String getAbsolutePath() {
byte[] absolute = properPath(false);
return Util.toString(absolute);
}