21 |
21 |
22 #include "javajniutils.h" |
22 #include "javajniutils.h" |
23 #include "javasymbianoslayer.h" |
23 #include "javasymbianoslayer.h" |
24 #include "s60commonutils.h" |
24 #include "s60commonutils.h" |
25 #include "logger.h" |
25 #include "logger.h" |
|
26 #include "javaoslayer.h" |
26 |
27 |
27 #include "systempropertyprovider.h" |
28 #include "systempropertyprovider.h" |
28 #include "com_nokia_mj_impl_file_FileSystemUtils.h" |
29 #include "com_nokia_mj_impl_file_FileSystemUtils.h" |
29 |
30 |
30 using namespace std; |
31 using namespace std; |
106 return JniUtils::wstringToJstring(aJni, name); |
107 return JniUtils::wstringToJstring(aJni, name); |
107 } |
108 } |
108 |
109 |
109 /* |
110 /* |
110 * Class: com_nokia_mj_impl_file_FileSystemUtils |
111 * Class: com_nokia_mj_impl_file_FileSystemUtils |
111 * Method: _getForbiddenPaths |
112 * Method: _getMidpRoot |
112 * Signature: ()Ljava/lang/String; |
113 * Signature: ()Ljava/lang/String; |
113 */ |
114 */ |
114 JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_file_FileSystemUtils__1getForbiddenPaths |
115 JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_file_FileSystemUtils__1getMidpRoot |
115 (JNIEnv *aJni, jclass) |
116 (JNIEnv *aEnv, jclass) |
116 { |
117 { |
117 JELOG2(EJavaFile); |
118 std::string path; |
118 jstring str = 0; |
119 java::util::JavaOsLayer::getMidpRoot(path); |
119 HBufC* names = 0; |
|
120 |
120 |
121 SystemPropertyProvider::GetForbiddenPaths(names); |
121 return aEnv->NewStringUTF((const char*)(path.c_str())); |
122 TPtrC namePtr(names->Des()); |
|
123 if (0 != names) |
|
124 { |
|
125 str = S60CommonUtils::NativeToJavaString(*aJni, namePtr); |
|
126 delete names; |
|
127 } |
|
128 return str; |
|
129 } |
122 } |
130 |
|
131 /* |
|
132 * Class: com_nokia_mj_impl_file_FileSystemUtils |
|
133 * Method: _getRestrictedPaths |
|
134 * Signature: ()Ljava/lang/String; |
|
135 */ |
|
136 JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_file_FileSystemUtils__1getRestrictedPaths |
|
137 (JNIEnv *aJni, jclass) |
|
138 { |
|
139 JELOG2(EJavaFile); |
|
140 jstring str = 0; |
|
141 HBufC* names = 0; |
|
142 |
|
143 TRAPD(err, SystemPropertyProvider::GetRestrictedPathsL(names)); |
|
144 |
|
145 if (KErrNone == err) |
|
146 { |
|
147 TPtrC namePtr(names->Des()); |
|
148 if (0 != names) |
|
149 { |
|
150 str = S60CommonUtils::NativeToJavaString(*aJni, namePtr); |
|
151 delete names; |
|
152 } |
|
153 } |
|
154 return str; |
|
155 } |
|